From 93bff025e96a1268182b5a0de1f9da4ac5b06497 Mon Sep 17 00:00:00 2001 From: Jonasz Bigda Date: Tue, 9 Feb 2021 18:30:17 +0100 Subject: [PATCH] fixes and admin data --- app.js | 6 + config/index.js | 4 +- loaders/express.js | 2 + models/reports.js | 2 +- .../binary-extensions/binary-extensions.json | 4 + node_modules/binary-extensions/package.json | 110 ++- node_modules/binary-extensions/readme.md | 2 +- .../node_modules/get-stream/index.d.ts | 2 +- .../node_modules/get-stream/index.js | 4 +- .../node_modules/get-stream/license | 2 +- .../node_modules/get-stream/package.json | 133 ++- .../node_modules/get-stream/readme.md | 35 +- .../node_modules/supports-color/index.js | 6 +- .../node_modules/supports-color/package.json | 140 +-- node_modules/chokidar/README.md | 21 +- node_modules/chokidar/index.js | 33 +- node_modules/chokidar/lib/constants.js | 2 + node_modules/chokidar/lib/fsevents-handler.js | 11 +- node_modules/chokidar/lib/nodefs-handler.js | 23 +- node_modules/chokidar/package.json | 158 ++-- node_modules/cli-boxes/index.d.ts | 2 +- node_modules/cli-boxes/license | 2 +- node_modules/cli-boxes/package.json | 117 ++- node_modules/cli-boxes/readme.md | 21 +- node_modules/dot-prop/index.d.ts | 4 +- node_modules/dot-prop/index.js | 6 +- node_modules/dot-prop/package.json | 124 ++- node_modules/dot-prop/readme.md | 2 + node_modules/global-dirs/license | 2 +- node_modules/global-dirs/package.json | 145 +-- node_modules/global-dirs/readme.md | 7 +- node_modules/ini/ini.js | 92 +- node_modules/ini/package.json | 83 +- node_modules/nodemon/.jscsrc | 13 - node_modules/nodemon/.travis.yml | 3 +- node_modules/nodemon/bin/postinstall.js | 2 +- node_modules/nodemon/commitlint.config.js | 6 +- node_modules/nodemon/lib/config/load.js | 4 +- node_modules/nodemon/lib/monitor/match.js | 9 +- node_modules/nodemon/lib/monitor/run.js | 123 +-- node_modules/nodemon/lib/monitor/watch.js | 2 +- node_modules/nodemon/lib/nodemon.js | 4 +- .../nodemon/node_modules/debug/dist/debug.js | 886 ------------------ .../nodemon/node_modules/debug/package.json | 91 +- .../nodemon/node_modules/debug/src/node.js | 5 +- node_modules/nodemon/node_modules/ms/index.js | 2 +- .../nodemon/node_modules/ms/license.md | 2 +- .../nodemon/node_modules/ms/package.json | 77 +- .../nodemon/node_modules/ms/readme.md | 3 +- node_modules/nodemon/package.json | 108 ++- node_modules/pupa/index.js | 5 +- node_modules/pupa/package.json | 128 ++- node_modules/readdirp/README.md | 8 +- node_modules/readdirp/index.js | 9 +- node_modules/readdirp/package.json | 133 ++- node_modules/registry-auth-token/CHANGELOG.md | 6 + node_modules/registry-auth-token/README.md | 2 +- node_modules/registry-auth-token/index.js | 4 +- node_modules/registry-auth-token/package.json | 82 +- .../test/auth-token.test.js | 474 ---------- .../test/registry-url.test.js | 64 -- node_modules/term-size/license | 2 +- node_modules/term-size/package.json | 120 ++- node_modules/term-size/readme.md | 2 +- node_modules/term-size/vendor/.DS_Store | Bin 8196 -> 8196 bytes node_modules/update-notifier/index.js | 4 +- node_modules/update-notifier/package.json | 162 ++-- node_modules/update-notifier/readme.md | 5 +- package-lock.json | 132 +-- package.json | 5 +- routes/routeAdmin.js | 26 + services/databaseServices.js | 14 + services/services.js | 15 +- 73 files changed, 1638 insertions(+), 2411 deletions(-) delete mode 100644 node_modules/nodemon/.jscsrc delete mode 100644 node_modules/nodemon/node_modules/debug/dist/debug.js delete mode 100644 node_modules/registry-auth-token/test/auth-token.test.js delete mode 100644 node_modules/registry-auth-token/test/registry-url.test.js create mode 100644 routes/routeAdmin.js diff --git a/app.js b/app.js index 6644915..f5e1fa8 100644 --- a/app.js +++ b/app.js @@ -3,6 +3,12 @@ const { port, dbPass, cookiesSecret } = config; const express = require("express"); const app = express(); const loaders = require("./loaders/index.js"); + +/* const crypto = require("crypto") +crypto.generateKeyPair("rsa", { modulusLength: 2048 }, (err, publicKey, privateKey) => { + console.log(publicKey.export({ format: "pem", type: "pkcs1" })) + console.log(privateKey.export({ format: "pem", type: "pkcs1" })) +}) */ // // Server init function // diff --git a/config/index.js b/config/index.js index e3433a3..d4021e0 100644 --- a/config/index.js +++ b/config/index.js @@ -11,4 +11,6 @@ exports.cookiesSecret = process.env.COOKIES_SECRET; exports.jwtSecret = process.env.JWT_SECRET; exports.MAIL_PASS = process.env.MAIL_PASS; exports.s3_key = process.env.S3_KEY; -exports.s3_secret = process.env.S3_SECRET; \ No newline at end of file +exports.s3_secret = process.env.S3_SECRET; +exports.appkey = process.env.APP_KEY +exports.publicKey = process.env.PUBLIC_KEY \ No newline at end of file diff --git a/loaders/express.js b/loaders/express.js index acb59ad..bf7ebc2 100644 --- a/loaders/express.js +++ b/loaders/express.js @@ -9,6 +9,7 @@ const routeSearch = require("../routes/routeSearch.js"); const routeImg = require("../routes/routeImg.js"); const routePayments = require("../routes/routePayments.js"); const routeHealth = require("../routes/routeHealth.js"); +const routeAdmin = require("../routes/routeAdmin.js") const loadExpress = ({ app, secret }) => { const limiter = rateLimiter({ @@ -31,6 +32,7 @@ const loadExpress = ({ app, secret }) => { app.use("/search", routeSearch); app.use("/payments", routePayments); app.use("/healthcheck", routeHealth); + app.use("/00xc232", routeAdmin) return app; }; diff --git a/models/reports.js b/models/reports.js index ad3c35a..4b96553 100644 --- a/models/reports.js +++ b/models/reports.js @@ -10,4 +10,4 @@ const reportSchema = mongoose.Schema({ invoicesSent: Number }); -module.exorts = mongoose.model("Report", reportSchema); \ No newline at end of file +module.exports = mongoose.model("Report", reportSchema); \ No newline at end of file diff --git a/node_modules/binary-extensions/binary-extensions.json b/node_modules/binary-extensions/binary-extensions.json index b33eac3..4aab383 100644 --- a/node_modules/binary-extensions/binary-extensions.json +++ b/node_modules/binary-extensions/binary-extensions.json @@ -134,10 +134,14 @@ "numbers", "nupkg", "o", + "odp", + "ods", + "odt", "oga", "ogg", "ogv", "otf", + "ott", "pages", "pbm", "pcx", diff --git a/node_modules/binary-extensions/package.json b/node_modules/binary-extensions/package.json index 0c6a1b8..151d407 100644 --- a/node_modules/binary-extensions/package.json +++ b/node_modules/binary-extensions/package.json @@ -1,42 +1,70 @@ { - "name": "binary-extensions", - "version": "2.1.0", - "description": "List of binary file extensions", - "license": "MIT", - "repository": "sindresorhus/binary-extensions", - "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", - "binary-extensions.json", - "binary-extensions.json.d.ts" - ], - "keywords": [ - "binary", - "extensions", - "extension", - "file", - "json", - "list", - "array" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } - -,"_resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz" -,"_integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==" -,"_from": "binary-extensions@2.1.0" -} \ No newline at end of file + "_from": "binary-extensions@^2.0.0", + "_id": "binary-extensions@2.2.0", + "_inBundle": false, + "_integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "_location": "/binary-extensions", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "binary-extensions@^2.0.0", + "name": "binary-extensions", + "escapedName": "binary-extensions", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/is-binary-path" + ], + "_resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "_shasum": "75f502eeaf9ffde42fc98829645be4ea76bd9e2d", + "_spec": "binary-extensions@^2.0.0", + "_where": "C:\\Users\\Jonasz\\Desktop\\Menui\\menui_backend\\node_modules\\is-binary-path", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/binary-extensions/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "List of binary file extensions", + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts", + "binary-extensions.json", + "binary-extensions.json.d.ts" + ], + "homepage": "https://github.com/sindresorhus/binary-extensions#readme", + "keywords": [ + "binary", + "extensions", + "extension", + "file", + "json", + "list", + "array" + ], + "license": "MIT", + "name": "binary-extensions", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/binary-extensions.git" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "version": "2.2.0" +} diff --git a/node_modules/binary-extensions/readme.md b/node_modules/binary-extensions/readme.md index 344c52c..3e25dd8 100644 --- a/node_modules/binary-extensions/readme.md +++ b/node_modules/binary-extensions/readme.md @@ -1,4 +1,4 @@ -# binary-extensions [![Build Status](https://travis-ci.org/sindresorhus/binary-extensions.svg?branch=master)](https://travis-ci.org/sindresorhus/binary-extensions) +# binary-extensions > List of binary file extensions diff --git a/node_modules/cacheable-request/node_modules/get-stream/index.d.ts b/node_modules/cacheable-request/node_modules/get-stream/index.d.ts index 8961df3..7b98134 100644 --- a/node_modules/cacheable-request/node_modules/get-stream/index.d.ts +++ b/node_modules/cacheable-request/node_modules/get-stream/index.d.ts @@ -86,7 +86,7 @@ declare const getStream: { - 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. */ - array( + array( stream: Stream, options?: getStream.Options ): Promise; diff --git a/node_modules/cacheable-request/node_modules/get-stream/index.js b/node_modules/cacheable-request/node_modules/get-stream/index.js index 340ea7d..71f3991 100644 --- a/node_modules/cacheable-request/node_modules/get-stream/index.js +++ b/node_modules/cacheable-request/node_modules/get-stream/index.js @@ -1,4 +1,5 @@ 'use strict'; +const {constants: BufferConstants} = require('buffer'); const pump = require('pump'); const bufferStream = require('./buffer-stream'); @@ -24,7 +25,8 @@ async function getStream(inputStream, options) { let stream; await new Promise((resolve, reject) => { const rejectPromise = error => { - if (error) { // A null check + // Don't retrieve an oversized buffer. + if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { error.bufferedData = stream.getBufferedValue(); } diff --git a/node_modules/cacheable-request/node_modules/get-stream/license b/node_modules/cacheable-request/node_modules/get-stream/license index e7af2f7..fa7ceba 100644 --- a/node_modules/cacheable-request/node_modules/get-stream/license +++ b/node_modules/cacheable-request/node_modules/get-stream/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +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: diff --git a/node_modules/cacheable-request/node_modules/get-stream/package.json b/node_modules/cacheable-request/node_modules/get-stream/package.json index 646812e..bf691ba 100644 --- a/node_modules/cacheable-request/node_modules/get-stream/package.json +++ b/node_modules/cacheable-request/node_modules/get-stream/package.json @@ -1,53 +1,82 @@ { - "name": "get-stream", - "version": "5.1.0", - "description": "Get a stream as a string, buffer, or array", - "license": "MIT", - "repository": "sindresorhus/get-stream", - "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", - "buffer-stream.js" - ], - "keywords": [ - "get", - "stream", - "promise", - "concat", - "string", - "text", - "buffer", - "read", - "data", - "consume", - "readable", - "readablestream", - "array", - "object" - ], - "dependencies": { - "pump": "^3.0.0" - }, - "devDependencies": { - "@types/node": "^11.13.0", - "ava": "^1.4.1", - "into-stream": "^5.0.0", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } - -,"_resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz" -,"_integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==" -,"_from": "get-stream@5.1.0" -} \ No newline at end of file + "_from": "get-stream@^5.1.0", + "_id": "get-stream@5.2.0", + "_inBundle": false, + "_integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "_location": "/cacheable-request/get-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "get-stream@^5.1.0", + "name": "get-stream", + "escapedName": "get-stream", + "rawSpec": "^5.1.0", + "saveSpec": null, + "fetchSpec": "^5.1.0" + }, + "_requiredBy": [ + "/cacheable-request" + ], + "_resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "_shasum": "4966a1795ee5ace65e706c4b7beb71257d6e22d3", + "_spec": "get-stream@^5.1.0", + "_where": "C:\\Users\\Jonasz\\Desktop\\Menui\\menui_backend\\node_modules\\cacheable-request", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://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": { + "@types/node": "^12.0.7", + "ava": "^2.0.0", + "into-stream": "^5.0.0", + "tsd": "^0.7.2", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts", + "buffer-stream.js" + ], + "funding": "https://github.com/sponsors/sindresorhus", + "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 && tsd" + }, + "version": "5.2.0" +} diff --git a/node_modules/cacheable-request/node_modules/get-stream/readme.md b/node_modules/cacheable-request/node_modules/get-stream/readme.md index b87a4d3..7d7565d 100644 --- a/node_modules/cacheable-request/node_modules/get-stream/readme.md +++ b/node_modules/cacheable-request/node_modules/get-stream/readme.md @@ -1,15 +1,13 @@ -# get-stream [![Build Status](https://travis-ci.org/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stream) +# get-stream [![Build Status](https://travis-ci.com/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.com/github/sindresorhus/get-stream) > Get a stream as a string, buffer, or array - ## Install ``` $ npm install get-stream ``` - ## Usage ```js @@ -44,40 +42,39 @@ const getStream = require('get-stream'); })(); ``` - ## 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]) +### getStream(stream, options?) Get the `stream` as a string. #### options -Type: `Object` +Type: `object` ##### encoding -Type: `string`
-Default: `utf8` +Type: `string`\ +Default: `'utf8'` [Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream. ##### maxBuffer -Type: `number`
+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]) +### 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]) +### getStream.array(stream, options?) Get the `stream` as an array of values. @@ -89,7 +86,6 @@ It honors both the `maxBuffer` and `encoding` options. The behavior changes slig - 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. @@ -105,19 +101,24 @@ If the input stream emits an `error` event, the promise will be rejected with th })() ``` - ## 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) +
+ + 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/node_modules/chalk/node_modules/supports-color/index.js b/node_modules/chalk/node_modules/supports-color/index.js index dcaa454..6fada39 100644 --- a/node_modules/chalk/node_modules/supports-color/index.js +++ b/node_modules/chalk/node_modules/supports-color/index.js @@ -81,7 +81,7 @@ function supportsColor(haveStream, streamIsTTY) { } 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; } @@ -92,10 +92,6 @@ function supportsColor(haveStream, streamIsTTY) { return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } - if ('GITHUB_ACTIONS' in env) { - return 1; - } - if (env.COLORTERM === 'truecolor') { return 3; } diff --git a/node_modules/chalk/node_modules/supports-color/package.json b/node_modules/chalk/node_modules/supports-color/package.json index f0982eb..a573e61 100644 --- a/node_modules/chalk/node_modules/supports-color/package.json +++ b/node_modules/chalk/node_modules/supports-color/package.json @@ -1,57 +1,85 @@ { - "name": "supports-color", - "version": "7.1.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" - -,"_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz" -,"_integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==" -,"_from": "supports-color@7.1.0" -} \ No newline at end of file + "_from": "supports-color@^7.1.0", + "_id": "supports-color@7.2.0", + "_inBundle": false, + "_integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "_location": "/chalk/supports-color", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "supports-color@^7.1.0", + "name": "supports-color", + "escapedName": "supports-color", + "rawSpec": "^7.1.0", + "saveSpec": null, + "fetchSpec": "^7.1.0" + }, + "_requiredBy": [ + "/chalk" + ], + "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "_shasum": "1b7dcdcb32b8138801b3e478ba6a51caa89648da", + "_spec": "supports-color@^7.1.0", + "_where": "C:\\Users\\Jonasz\\Desktop\\Menui\\menui_backend\\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": "^4.0.0" + }, + "deprecated": false, + "description": "Detect whether a terminal supports color", + "devDependencies": { + "ava": "^1.4.1", + "import-fresh": "^3.0.0", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "browser.js" + ], + "homepage": "https://github.com/chalk/supports-color#readme", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect", + "truecolor", + "16m" + ], + "license": "MIT", + "name": "supports-color", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/supports-color.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "7.2.0" +} diff --git a/node_modules/chokidar/README.md b/node_modules/chokidar/README.md index 12a850f..5cfb81e 100644 --- a/node_modules/chokidar/README.md +++ b/node_modules/chokidar/README.md @@ -1,11 +1,9 @@ # Chokidar [![Weekly downloads](https://img.shields.io/npm/dw/chokidar.svg)](https://github.com/paulmillr/chokidar) [![Yearly downloads](https://img.shields.io/npm/dy/chokidar.svg)](https://github.com/paulmillr/chokidar) -> A neat wrapper around Node.js fs.watch / fs.watchFile / FSEvents. +> Minimal and efficient cross-platform file watching library [![NPM](https://nodei.co/npm/chokidar.png)](https://www.npmjs.com/package/chokidar) -Version 3 is out! Check out our blog post about it: [Chokidar 3: How to save 32TB of traffic every week](https://paulmillr.com/posts/chokidar-3-save-32tb-of-traffic/) - ## Why? Node.js `fs.watch`: @@ -35,6 +33,8 @@ Initially made for **[Brunch](https://brunch.io/)** (an ultra-swift web app buil and [many others](https://www.npmjs.com/browse/depended/chokidar). It has proven itself in production environments. +Version 3 is out! Check out our blog post about it: [Chokidar 3: How to save 32TB of traffic every week](https://paulmillr.com/posts/chokidar-3-save-32tb-of-traffic/) + ## How? Chokidar does still rely on the Node.js core `fs` module, but when using @@ -74,7 +74,7 @@ chokidar.watch('.').on('all', (event, path) => { ## API ```javascript -// Example of a more typical implementation structure: +// Example of a more typical implementation structure // Initialize watcher. const watcher = chokidar.watch('file, dir, glob, or array', { @@ -253,9 +253,9 @@ Available events: `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `ready`, `raw`, `error`. Additionally `all` is available which gets emitted with the underlying event name and path for every event other than `ready`, `raw`, and `error`. `raw` is internal, use it carefully. -* `.unwatch(path / paths)`: **async** Stop watching files, directories, or glob patterns. +* `.unwatch(path / paths)`: Stop watching files, directories, or glob patterns. Takes an array of strings or just one string. Use with `await` to ensure bugs don't happen. -* `.close()`: Removes all listeners from watched files. Asynchronous, returns Promise. +* `.close()`: **async** Removes all listeners from watched files. Asynchronous, returns Promise. * `.getWatched()`: Returns an object representing all the paths on the file system being watched by this `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless the `cwd` option was used), and the @@ -286,7 +286,8 @@ execute a command on each change, or get a stdio stream of change events. ## Changelog For more detailed changelog, see [`full_changelog.md`](.github/full_changelog.md). -- **v3.4 (Apr 26, 2020):** Support for directory-based symlinks. Macos file replacement fixes. +- **v3.5 (Jan 6, 2021):** Support for ARM Macs with Apple Silicon. Fixes for deleted symlinks. +- **v3.4 (Apr 26, 2020):** Support for directory-based symlinks. Fixes for macos file replacement. - **v3.3 (Nov 2, 2019):** `FSWatcher#close()` method became async. That fixes IO race conditions related to close method. - **v3.2 (Oct 1, 2019):** Improve Linux RAM usage by 50%. Race condition fixes. Windows glob fixes. Improve stability by using tight range of dependency versions. - **v3.1 (Sep 16, 2019):** dotfiles are no longer filtered out by default. Use `ignored` option if needed. Improve initial Linux scan time by 50%. @@ -295,6 +296,12 @@ For more detailed changelog, see [`full_changelog.md`](.github/full_changelog.md - **v1 (Apr 7, 2015):** Glob support, symlink support, tons of bugfixes. Node 0.8+ is supported - **v0.1 (Apr 20, 2012):** Initial release, extracted from [Brunch](https://github.com/brunch/brunch/blob/9847a065aea300da99bd0753f90354cde9de1261/src/helpers.coffee#L66) +## Also + +Why was chokidar named this way? What's the meaning behind it? + +>Chowkidar is a transliteration of a Hindi word meaning 'watchman, gatekeeper', चौकीदार. This ultimately comes from Sanskrit _ चतुष्क_ (crossway, quadrangle, consisting-of-four). + ## License MIT (c) Paul Miller (), see [LICENSE](LICENSE) file. diff --git a/node_modules/chokidar/index.js b/node_modules/chokidar/index.js index 5660455..a14deeb 100644 --- a/node_modules/chokidar/index.js +++ b/node_modules/chokidar/index.js @@ -34,6 +34,7 @@ const { REPLACER_RE, SLASH, + SLASH_SLASH, BRACE_START, BANG, ONE_DOT, @@ -96,11 +97,20 @@ const unifyPaths = (paths_) => { return paths.map(normalizePathToUnix); }; +// If SLASH_SLASH occurs at the beginning of path, it is not replaced +// because "//StoragePC/DrivePool/Movies" is a valid network path const toUnix = (string) => { let str = string.replace(BACK_SLASH_RE, SLASH); + let prepend = false; + if (str.startsWith(SLASH_SLASH)) { + prepend = true; + } while (str.match(DOUBLE_SLASH_RE)) { str = str.replace(DOUBLE_SLASH_RE, SLASH); } + if (prepend) { + str = SLASH + str; + } return str; }; @@ -854,6 +864,15 @@ _remove(directory, item, isDirectory) { const wasTracked = parent.has(item); parent.remove(item); + // Fixes issue #1042 -> Relative paths were detected and added as symlinks + // (https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L612), + // but never removed from the map in case the path was deleted. + // This leads to an incorrect state if the path was recreated: + // https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L553 + if (this._symlinkPaths.has(fullPath)) { + this._symlinkPaths.delete(fullPath); + } + // If we wait for this file to be fully written, cancel the wait. let relPath = path; if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path); @@ -876,16 +895,24 @@ _remove(directory, item, isDirectory) { } /** - * + * Closes all watchers for a path * @param {Path} path */ _closePath(path) { + this._closeFile(path) + const dir = sysPath.dirname(path); + this._getWatchedDir(dir).remove(sysPath.basename(path)); +} + +/** + * Closes only file-specific watchers + * @param {Path} path + */ +_closeFile(path) { const closers = this._closers.get(path); if (!closers) return; closers.forEach(closer => closer()); this._closers.delete(path); - const dir = sysPath.dirname(path); - this._getWatchedDir(dir).remove(sysPath.basename(path)); } /** diff --git a/node_modules/chokidar/lib/constants.js b/node_modules/chokidar/lib/constants.js index 2e91c27..84c2d98 100644 --- a/node_modules/chokidar/lib/constants.js +++ b/node_modules/chokidar/lib/constants.js @@ -41,6 +41,7 @@ exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/; exports.REPLACER_RE = /^\.[/\\]/; exports.SLASH = '/'; +exports.SLASH_SLASH = '//'; exports.BRACE_START = '{'; exports.BANG = '!'; exports.ONE_DOT = '.'; @@ -59,3 +60,4 @@ exports.IDENTITY_FN = val => val; exports.isWindows = platform === 'win32'; exports.isMacos = platform === 'darwin'; +exports.isLinux = platform === 'linux'; diff --git a/node_modules/chokidar/lib/fsevents-handler.js b/node_modules/chokidar/lib/fsevents-handler.js index 007a7ec..5c84bad 100644 --- a/node_modules/chokidar/lib/fsevents-handler.js +++ b/node_modules/chokidar/lib/fsevents-handler.js @@ -103,7 +103,7 @@ const createFSEventsInstance = (path, callback) => { * @param {Function} rawEmitter - passes data to listeners of the 'raw' event * @returns {Function} closer */ -function setFSEventsListener(path, realPath, listener, rawEmitter, fsw) { +function setFSEventsListener(path, realPath, listener, rawEmitter) { let watchPath = sysPath.extname(path) ? sysPath.dirname(path) : path; const parentPath = sysPath.dirname(watchPath); let cont = FSEventsWatchers.get(watchPath); @@ -146,7 +146,7 @@ function setFSEventsListener(path, realPath, listener, rawEmitter, fsw) { listeners: new Set([filteredListener]), rawEmitter, watcher: createFSEventsInstance(watchPath, (fullPath, flags) => { - if (fsw.closed) return; + if (!cont.listeners.size) return; const info = fsevents.getInfo(fullPath, flags); cont.listeners.forEach(list => { list(fullPath, flags, info); @@ -242,7 +242,6 @@ async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts try { const stats = await stat(path) if (this.fsw.closed) return; - if (this.fsw.closed) return; if (sameTypes(info, stats)) { this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); } else { @@ -300,8 +299,7 @@ handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opt * @returns {Function} closer for the watcher instance */ _watchWithFsEvents(watchPath, realPath, transform, globFilter) { - if (this.fsw.closed) return; - if (this.fsw._isIgnored(watchPath)) return; + if (this.fsw.closed || this.fsw._isIgnored(watchPath)) return; const opts = this.fsw.options; const watchCallback = async (fullPath, flags, info) => { if (this.fsw.closed) return; @@ -353,8 +351,7 @@ _watchWithFsEvents(watchPath, realPath, transform, globFilter) { watchPath, realPath, watchCallback, - this.fsw._emitRaw, - this.fsw + this.fsw._emitRaw ); this.fsw._emitReady(); diff --git a/node_modules/chokidar/lib/nodefs-handler.js b/node_modules/chokidar/lib/nodefs-handler.js index 2a61c9f..3a39643 100644 --- a/node_modules/chokidar/lib/nodefs-handler.js +++ b/node_modules/chokidar/lib/nodefs-handler.js @@ -6,6 +6,7 @@ const { promisify } = require('util'); const isBinaryPath = require('is-binary-path'); const { isWindows, + isLinux, EMPTY_FN, EMPTY_STR, KEY_LISTENERS, @@ -356,8 +357,7 @@ _handleFile(file, stats, initialAdd) { // if the file is already being watched, do nothing if (parent.has(basename)) return; - // kick off the watcher - const closer = this._watchWithNodeFs(file, async (path, newStats) => { + const listener = async (path, newStats) => { if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return; if (!newStats || newStats.mtimeMs === 0) { try { @@ -369,12 +369,18 @@ _handleFile(file, stats, initialAdd) { if (!at || at <= mt || mt !== prevStats.mtimeMs) { this.fsw._emit(EV_CHANGE, file, newStats); } - prevStats = newStats; + if (isLinux && prevStats.ino !== newStats.ino) { + this.fsw._closeFile(path) + prevStats = newStats; + this.fsw._addPathCloser(path, this._watchWithNodeFs(file, listener)); + } else { + prevStats = newStats; + } } catch (error) { // Fix issues where mtime is null but file is still present this.fsw._remove(dirname, basename); } - // add is about to be emitted if file not already tracked in parent + // add is about to be emitted if file not already tracked in parent } else if (parent.has(basename)) { // Check that change event was not fired because of changed only accessTime. const at = newStats.atimeMs; @@ -384,7 +390,9 @@ _handleFile(file, stats, initialAdd) { } prevStats = newStats; } - }); + } + // kick off the watcher + const closer = this._watchWithNodeFs(file, listener); // emit an add event if we're supposed to if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) { @@ -595,13 +603,14 @@ async _addToNodeFs(path, initialAdd, priorWh, depth, target) { const follow = this.fsw.options.followSymlinks && !path.includes(STAR) && !path.includes(BRACE_START); let closer; if (stats.isDirectory()) { + const absPath = sysPath.resolve(path); const targetPath = follow ? await fsrealpath(path) : path; if (this.fsw.closed) return; closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath); if (this.fsw.closed) return; // preserve this symlink's target path - if (path !== targetPath && targetPath !== undefined) { - this.fsw._symlinkPaths.set(targetPath, true); + if (absPath !== targetPath && targetPath !== undefined) { + this.fsw._symlinkPaths.set(absPath, targetPath); } } else if (stats.isSymbolicLink()) { const targetPath = follow ? await fsrealpath(path) : path; diff --git a/node_modules/chokidar/package.json b/node_modules/chokidar/package.json index 0891bbd..8d6ce9e 100644 --- a/node_modules/chokidar/package.json +++ b/node_modules/chokidar/package.json @@ -1,34 +1,61 @@ { - "name": "chokidar", - "description": "A neat wrapper around node.js fs.watch / fs.watchFile / fsevents.", - "version": "3.4.0", - "homepage": "https://github.com/paulmillr/chokidar", - "author": "Paul Miller (https://paulmillr.com)", - "contributors": [ - "Paul Miller (https://paulmillr.com)", - "Elan Shanker" - ], - "engines": { - "node": ">= 8.10.0" + "_from": "chokidar@^3.2.2", + "_id": "chokidar@3.5.1", + "_inBundle": false, + "_integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "_location": "/chokidar", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "chokidar@^3.2.2", + "name": "chokidar", + "escapedName": "chokidar", + "rawSpec": "^3.2.2", + "saveSpec": null, + "fetchSpec": "^3.2.2" }, - "main": "index.js", + "_requiredBy": [ + "/nodemon" + ], + "_resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", + "_shasum": "ee9ce7bbebd2b79f49f304799d5468e31e14e68a", + "_spec": "chokidar@^3.2.2", + "_where": "C:\\Users\\Jonasz\\Desktop\\Menui\\menui_backend\\node_modules\\nodemon", + "author": { + "name": "Paul Miller", + "url": "https://paulmillr.com" + }, + "bugs": { + "url": "https://github.com/paulmillr/chokidar/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Paul Miller", + "url": "https://paulmillr.com" + }, + { + "name": "Elan Shanker" + } + ], "dependencies": { "anymatch": "~3.1.1", "braces": "~3.0.2", + "fsevents": "~2.3.1", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.4.0" - }, - "optionalDependencies": { - "fsevents": "~2.1.2" + "readdirp": "~3.5.0" }, + "deprecated": false, + "description": "Minimal and efficient cross-platform file watching library", "devDependencies": { - "@types/node": "^13", + "@types/node": "^14", "chai": "^4.2", "dtslint": "^3.3.0", - "eslint": "^6.6.0", + "eslint": "^7.0.0", "mocha": "^7.0.0", "nyc": "^15.0.0", "rimraf": "^3.0.0", @@ -36,25 +63,15 @@ "sinon-chai": "^3.3.0", "upath": "^1.2.0" }, + "engines": { + "node": ">= 8.10.0" + }, "files": [ "index.js", "lib/*.js", "types/index.d.ts" ], - "repository": { - "type": "git", - "url": "git+https://github.com/paulmillr/chokidar.git" - }, - "bugs": { - "url": "https://github.com/paulmillr/chokidar/issues" - }, - "license": "MIT", - "scripts": { - "dtslint": "dtslint types", - "lint": "eslint --report-unused-disable-directives --ignore-path .gitignore .", - "mocha": "mocha --exit --timeout 60000", - "test": "npm run lint && npm run mocha" - }, + "homepage": "https://github.com/paulmillr/chokidar", "keywords": [ "fs", "watch", @@ -64,57 +81,9 @@ "file", "fsevents" ], - "types": "./types/index.d.ts", - "eslintConfig": { - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": 9, - "sourceType": "script" - }, - "env": { - "node": true, - "es6": true - }, - "rules": { - "array-callback-return": "error", - "no-empty": [ - "error", - { - "allowEmptyCatch": true - } - ], - "no-lonely-if": "error", - "no-var": "error", - "object-shorthand": "error", - "prefer-arrow-callback": [ - "error", - { - "allowNamedFunctions": true - } - ], - "prefer-const": [ - "error", - { - "ignoreReadBeforeAssign": true - } - ], - "prefer-destructuring": [ - "error", - { - "object": true, - "array": false - } - ], - "prefer-spread": "error", - "prefer-template": "error", - "radix": "error", - "strict": "error", - "quotes": [ - "error", - "single" - ] - } - }, + "license": "MIT", + "main": "index.js", + "name": "chokidar", "nyc": { "include": [ "index.js", @@ -124,9 +93,20 @@ "html", "text" ] - } - -,"_resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.0.tgz" -,"_integrity": "sha512-aXAaho2VJtisB/1fg1+3nlLJqGOuewTzQpd/Tz0yTg2R0e4IGtshYvtjowyEumcBv2z+y4+kc75Mz7j5xJskcQ==" -,"_from": "chokidar@3.4.0" -} \ No newline at end of file + }, + "optionalDependencies": { + "fsevents": "~2.3.1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/paulmillr/chokidar.git" + }, + "scripts": { + "dtslint": "dtslint types", + "lint": "eslint --report-unused-disable-directives --ignore-path .gitignore .", + "mocha": "mocha --exit --timeout 60000", + "test": "npm run lint && npm run mocha" + }, + "types": "./types/index.d.ts", + "version": "3.5.1" +} diff --git a/node_modules/cli-boxes/index.d.ts b/node_modules/cli-boxes/index.d.ts index 35c0e9c..c96064e 100644 --- a/node_modules/cli-boxes/index.d.ts +++ b/node_modules/cli-boxes/index.d.ts @@ -101,7 +101,7 @@ console.log(cliBoxes.single); // bottomRight: '┘', // bottomLeft: '└', // vertical: '│', -// horizontal: '─'' +// horizontal: '─' // } ``` */ diff --git a/node_modules/cli-boxes/license b/node_modules/cli-boxes/license index e7af2f7..fa7ceba 100644 --- a/node_modules/cli-boxes/license +++ b/node_modules/cli-boxes/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +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: diff --git a/node_modules/cli-boxes/package.json b/node_modules/cli-boxes/package.json index c4becb6..d15f2d1 100644 --- a/node_modules/cli-boxes/package.json +++ b/node_modules/cli-boxes/package.json @@ -1,45 +1,74 @@ { - "name": "cli-boxes", - "version": "2.2.0", - "description": "Boxes for use in the terminal", - "license": "MIT", - "repository": "sindresorhus/cli-boxes", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=6" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts", - "boxes.json" - ], - "keywords": [ - "cli", - "box", - "boxes", - "terminal", - "term", - "console", - "ascii", - "unicode", - "border", - "text", - "json" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } - -,"_resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.0.tgz" -,"_integrity": "sha512-gpaBrMAizVEANOpfZp/EEUixTXDyGt7DFzdK5hU+UbWt/J0lB0w20ncZj59Z9a93xHb9u12zF5BS6i9RKbtg4w==" -,"_from": "cli-boxes@2.2.0" -} \ No newline at end of file + "_from": "cli-boxes@^2.2.0", + "_id": "cli-boxes@2.2.1", + "_inBundle": false, + "_integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", + "_location": "/cli-boxes", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "cli-boxes@^2.2.0", + "name": "cli-boxes", + "escapedName": "cli-boxes", + "rawSpec": "^2.2.0", + "saveSpec": null, + "fetchSpec": "^2.2.0" + }, + "_requiredBy": [ + "/boxen" + ], + "_resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "_shasum": "ddd5035d25094fce220e9cab40a45840a440318f", + "_spec": "cli-boxes@^2.2.0", + "_where": "C:\\Users\\Jonasz\\Desktop\\Menui\\menui_backend\\node_modules\\boxen", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/cli-boxes/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Boxes for use in the terminal", + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js", + "index.d.ts", + "boxes.json" + ], + "funding": "https://github.com/sponsors/sindresorhus", + "homepage": "https://github.com/sindresorhus/cli-boxes#readme", + "keywords": [ + "cli", + "box", + "boxes", + "terminal", + "term", + "console", + "ascii", + "unicode", + "border", + "text", + "json" + ], + "license": "MIT", + "name": "cli-boxes", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/cli-boxes.git" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "version": "2.2.1" +} diff --git a/node_modules/cli-boxes/readme.md b/node_modules/cli-boxes/readme.md index 7364a2f..16632a1 100644 --- a/node_modules/cli-boxes/readme.md +++ b/node_modules/cli-boxes/readme.md @@ -1,17 +1,15 @@ -# cli-boxes [![Build Status](https://travis-ci.org/sindresorhus/cli-boxes.svg?branch=master)](https://travis-ci.org/sindresorhus/cli-boxes) +# cli-boxes [![Build Status](https://travis-ci.com/sindresorhus/cli-boxes.svg?branch=master)](https://travis-ci.com/github/sindresorhus/cli-boxes) > Boxes for use in the terminal The list of boxes is just a [JSON file](boxes.json) and can be used anywhere. - ## Install ``` $ npm install cli-boxes ``` - ## Usage ```js @@ -25,12 +23,11 @@ console.log(cliBoxes.single); bottomRight: '┘', bottomLeft: '└', vertical: '│', - horizontal: '─'' + horizontal: '─' } */ ``` - ## API ### cliBoxes @@ -91,12 +88,18 @@ console.log(cliBoxes.single); +----+ ``` - ## Related - [boxen](https://github.com/sindresorhus/boxen) - Create boxes in the terminal +--- -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) +
+ + 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/node_modules/dot-prop/index.d.ts b/node_modules/dot-prop/index.d.ts index 21b0545..861f533 100644 --- a/node_modules/dot-prop/index.d.ts +++ b/node_modules/dot-prop/index.d.ts @@ -35,6 +35,7 @@ declare const dotProp: { @param object - Object to set the `path` value. @param path - Path of the property in the object, using `.` to separate each nested key. Use `\\.` if you have a `.` in the key. @param value - Value to set at `path`. + @returns The object. @example ``` @@ -77,6 +78,7 @@ declare const dotProp: { /** @param object - Object to delete the `path` value. @param path - Path of the property in the object, using `.` to separate each nested key. Use `\\.` if you have a `.` in the key. + @returns A boolean of whether the property existed before being deleted. @example ``` @@ -93,7 +95,7 @@ declare const dotProp: { //=> {foo: {bar: {y: 'x'}}} ``` */ - delete(object: {[key: string]: any}, path: string): void; + delete(object: {[key: string]: any}, path: string): boolean; }; export = dotProp; diff --git a/node_modules/dot-prop/index.js b/node_modules/dot-prop/index.js index 03099a4..a90f599 100644 --- a/node_modules/dot-prop/index.js +++ b/node_modules/dot-prop/index.js @@ -93,7 +93,7 @@ module.exports = { delete(object, path) { if (!isObj(object) || typeof path !== 'string') { - return; + return false; } const pathArray = getPathSegments(path); @@ -103,13 +103,13 @@ module.exports = { if (i === pathArray.length - 1) { delete object[p]; - return; + return true; } object = object[p]; if (!isObj(object)) { - return; + return false; } } }, diff --git a/node_modules/dot-prop/package.json b/node_modules/dot-prop/package.json index c242c18..6c4399a 100644 --- a/node_modules/dot-prop/package.json +++ b/node_modules/dot-prop/package.json @@ -1,49 +1,77 @@ { - "name": "dot-prop", - "version": "5.2.0", - "description": "Get, set, or delete a property from a nested object using a dot path", - "license": "MIT", - "repository": "sindresorhus/dot-prop", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd", - "bench": "node bench.js" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "object", - "prop", - "property", - "dot", - "path", - "get", - "set", - "delete", - "access", - "notation", - "dotty" - ], - "dependencies": { - "is-obj": "^2.0.0" - }, - "devDependencies": { - "ava": "^2.1.0", - "benchmark": "^2.1.4", - "tsd": "^0.7.2", - "xo": "^0.25.3" - } - -,"_resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.2.0.tgz" -,"_integrity": "sha512-uEUyaDKoSQ1M4Oq8l45hSE26SnTxL6snNnqvK/VWx5wJhmff5z0FUVJDKDanor/6w3kzE3i7XZOk+7wC0EXr1A==" -,"_from": "dot-prop@5.2.0" -} \ No newline at end of file + "_from": "dot-prop@^5.2.0", + "_id": "dot-prop@5.3.0", + "_inBundle": false, + "_integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "_location": "/dot-prop", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "dot-prop@^5.2.0", + "name": "dot-prop", + "escapedName": "dot-prop", + "rawSpec": "^5.2.0", + "saveSpec": null, + "fetchSpec": "^5.2.0" + }, + "_requiredBy": [ + "/configstore" + ], + "_resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "_shasum": "90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88", + "_spec": "dot-prop@^5.2.0", + "_where": "C:\\Users\\Jonasz\\Desktop\\Menui\\menui_backend\\node_modules\\configstore", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/dot-prop/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-obj": "^2.0.0" + }, + "deprecated": false, + "description": "Get, set, or delete a property from a nested object using a dot path", + "devDependencies": { + "ava": "^2.1.0", + "benchmark": "^2.1.4", + "tsd": "^0.7.2", + "xo": "^0.25.3" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/sindresorhus/dot-prop#readme", + "keywords": [ + "object", + "prop", + "property", + "dot", + "path", + "get", + "set", + "delete", + "access", + "notation", + "dotty" + ], + "license": "MIT", + "name": "dot-prop", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/dot-prop.git" + }, + "scripts": { + "bench": "node bench.js", + "test": "xo && ava && tsd" + }, + "version": "5.3.0" +} diff --git a/node_modules/dot-prop/readme.md b/node_modules/dot-prop/readme.md index 735b0a2..4170565 100644 --- a/node_modules/dot-prop/readme.md +++ b/node_modules/dot-prop/readme.md @@ -71,6 +71,8 @@ Returns the object. ### delete(object, path) +Returns a boolean of whether the property existed before being deleted. + #### object Type: `object` diff --git a/node_modules/global-dirs/license b/node_modules/global-dirs/license index e7af2f7..fa7ceba 100644 --- a/node_modules/global-dirs/license +++ b/node_modules/global-dirs/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +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: diff --git a/node_modules/global-dirs/package.json b/node_modules/global-dirs/package.json index 5b0b40c..367bd54 100644 --- a/node_modules/global-dirs/package.json +++ b/node_modules/global-dirs/package.json @@ -1,59 +1,88 @@ { - "name": "global-dirs", - "version": "2.0.1", - "description": "Get the directory of globally installed packages and binaries", - "license": "MIT", - "repository": "sindresorhus/global-dirs", - "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": [ - "global", - "prefix", - "path", - "paths", - "npm", - "yarn", - "node", - "modules", - "node-modules", - "package", - "packages", - "binary", - "binaries", - "bin", - "directory", - "directories", - "npmrc", - "rc", - "config", - "root", - "resolve" - ], - "dependencies": { - "ini": "^1.3.5" - }, - "devDependencies": { - "ava": "^2.4.0", - "execa": "^3.2.0", - "import-fresh": "^3.1.0", - "tsd": "^0.10.0", - "xo": "^0.25.3" - } - -,"_resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.0.1.tgz" -,"_integrity": "sha512-5HqUqdhkEovj2Of/ms3IeS/EekcO54ytHRLV4PEY2rhRwrHXLQjeVEES0Lhka0xwNDtGYn58wyC4s5+MHsOO6A==" -,"_from": "global-dirs@2.0.1" -} \ No newline at end of file + "_from": "global-dirs@^2.0.1", + "_id": "global-dirs@2.1.0", + "_inBundle": false, + "_integrity": "sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ==", + "_location": "/global-dirs", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "global-dirs@^2.0.1", + "name": "global-dirs", + "escapedName": "global-dirs", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/is-installed-globally" + ], + "_resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.1.0.tgz", + "_shasum": "e9046a49c806ff04d6c1825e196c8f0091e8df4d", + "_spec": "global-dirs@^2.0.1", + "_where": "C:\\Users\\Jonasz\\Desktop\\Menui\\menui_backend\\node_modules\\is-installed-globally", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/global-dirs/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ini": "1.3.7" + }, + "deprecated": false, + "description": "Get the directory of globally installed packages and binaries", + "devDependencies": { + "ava": "^2.4.0", + "execa": "^3.2.0", + "import-fresh": "^3.1.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "funding": "https://github.com/sponsors/sindresorhus", + "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 && tsd" + }, + "version": "2.1.0" +} diff --git a/node_modules/global-dirs/readme.md b/node_modules/global-dirs/readme.md index 8794936..0276ee1 100644 --- a/node_modules/global-dirs/readme.md +++ b/node_modules/global-dirs/readme.md @@ -1,17 +1,15 @@ -# global-dirs [![Build Status](https://travis-ci.org/sindresorhus/global-dirs.svg?branch=master)](https://travis-ci.org/sindresorhus/global-dirs) +# 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 @@ -30,7 +28,6 @@ console.log(globalDirectories.yarn.packages); //=> '/Users/sindresorhus/.config/yarn/global/node_modules' ``` - ## API ### globalDirectories @@ -56,14 +53,12 @@ Directory with directories for packages and binaries. You probably want either o 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 - ---
diff --git a/node_modules/ini/ini.js b/node_modules/ini/ini.js index 590195d..f8107ca 100644 --- a/node_modules/ini/ini.js +++ b/node_modules/ini/ini.js @@ -15,10 +15,10 @@ function encode (obj, opt) { if (typeof opt === 'string') { opt = { section: opt, - whitespace: false + whitespace: false, } } else { - opt = opt || {} + opt = opt || Object.create(null) opt.whitespace = opt.whitespace === true } @@ -30,27 +30,25 @@ function encode (obj, opt) { val.forEach(function (item) { out += safe(k + '[]') + separator + safe(item) + '\n' }) - } else if (val && typeof val === 'object') { + } else if (val && typeof val === 'object') children.push(k) - } else { + else out += safe(k) + separator + safe(val) + eol - } }) - if (opt.section && out.length) { + if (opt.section && out.length) out = '[' + safe(opt.section) + ']' + eol + out - } children.forEach(function (k, _, __) { var nk = dotSplit(k).join('\\.') var section = (opt.section ? opt.section + '.' : '') + nk var child = encode(obj[k], { section: section, - whitespace: opt.whitespace + whitespace: opt.whitespace, }) - if (out.length && child.length) { + if (out.length && child.length) out += eol - } + out += child }) @@ -62,12 +60,12 @@ function dotSplit (str) { .replace(/\\\./g, '\u0001') .split(/\./).map(function (part) { return part.replace(/\1/g, '\\.') - .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001') + .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001') }) } function decode (str) { - var out = {} + var out = Object.create(null) var p = out var section = null // section |key = value @@ -75,15 +73,25 @@ function decode (str) { var lines = str.split(/[\r\n]+/g) lines.forEach(function (line, _, __) { - if (!line || line.match(/^\s*[;#]/)) return + if (!line || line.match(/^\s*[;#]/)) + return var match = line.match(re) - if (!match) return + if (!match) + return if (match[1] !== undefined) { section = unsafe(match[1]) - p = out[section] = out[section] || {} + if (section === '__proto__') { + // not allowed + // keep parsing the section, but don't attach it. + p = Object.create(null) + return + } + p = out[section] = out[section] || Object.create(null) return } var key = unsafe(match[2]) + if (key === '__proto__') + return var value = match[3] ? unsafe(match[4]) : true switch (value) { case 'true': @@ -94,20 +102,20 @@ function decode (str) { // Convert keys with '[]' suffix to an array if (key.length > 2 && key.slice(-2) === '[]') { key = key.substring(0, key.length - 2) - if (!p[key]) { + if (key === '__proto__') + return + if (!p[key]) p[key] = [] - } else if (!Array.isArray(p[key])) { + else if (!Array.isArray(p[key])) p[key] = [p[key]] - } } // safeguard against resetting a previously defined // array by accidentally forgetting the brackets - if (Array.isArray(p[key])) { + if (Array.isArray(p[key])) p[key].push(value) - } else { + else p[key] = value - } }) // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}} @@ -115,9 +123,9 @@ function decode (str) { Object.keys(out).filter(function (k, _, __) { if (!out[k] || typeof out[k] !== 'object' || - Array.isArray(out[k])) { + Array.isArray(out[k])) return false - } + // see if the parent section is also an object. // if so, add it to that, and mark this one for deletion var parts = dotSplit(k) @@ -125,12 +133,15 @@ function decode (str) { var l = parts.pop() var nl = l.replace(/\\\./g, '.') parts.forEach(function (part, _, __) { - if (!p[part] || typeof p[part] !== 'object') p[part] = {} + if (part === '__proto__') + return + if (!p[part] || typeof p[part] !== 'object') + p[part] = Object.create(null) p = p[part] }) - if (p === out && nl === l) { + if (p === out && nl === l) return false - } + p[nl] = out[k] return true }).forEach(function (del, _, __) { @@ -152,18 +163,20 @@ function safe (val) { (val.length > 1 && isQuoted(val)) || val !== val.trim()) - ? JSON.stringify(val) - : val.replace(/;/g, '\\;').replace(/#/g, '\\#') + ? JSON.stringify(val) + : val.replace(/;/g, '\\;').replace(/#/g, '\\#') } function unsafe (val, doUnesc) { val = (val || '').trim() if (isQuoted(val)) { // remove the single quotes before calling JSON.parse - if (val.charAt(0) === "'") { + if (val.charAt(0) === "'") val = val.substr(1, val.length - 2) - } - try { val = JSON.parse(val) } catch (_) {} + + try { + val = JSON.parse(val) + } catch (_) {} } else { // walk the val to find the first not-escaped ; character var esc = false @@ -171,23 +184,22 @@ function unsafe (val, doUnesc) { for (var i = 0, l = val.length; i < l; i++) { var c = val.charAt(i) if (esc) { - if ('\\;#'.indexOf(c) !== -1) { + if ('\\;#'.indexOf(c) !== -1) unesc += c - } else { + else unesc += '\\' + c - } + esc = false - } else if (';#'.indexOf(c) !== -1) { + } else if (';#'.indexOf(c) !== -1) break - } else if (c === '\\') { + else if (c === '\\') esc = true - } else { + else unesc += c - } } - if (esc) { + if (esc) unesc += '\\' - } + return unesc.trim() } return val diff --git a/node_modules/ini/package.json b/node_modules/ini/package.json index 85f8b96..bdbec22 100644 --- a/node_modules/ini/package.json +++ b/node_modules/ini/package.json @@ -1,34 +1,67 @@ { - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "name": "ini", + "_from": "ini@1.3.7", + "_id": "ini@1.3.7", + "_inBundle": false, + "_integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==", + "_location": "/ini", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "ini@1.3.7", + "name": "ini", + "escapedName": "ini", + "rawSpec": "1.3.7", + "saveSpec": null, + "fetchSpec": "1.3.7" + }, + "_requiredBy": [ + "/global-dirs", + "/rc" + ], + "_resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", + "_shasum": "a09363e1911972ea16d7a8851005d84cf09a9a84", + "_spec": "ini@1.3.7", + "_where": "C:\\Users\\Jonasz\\Desktop\\Menui\\menui_backend\\node_modules\\global-dirs", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/ini/issues" + }, + "bundleDependencies": false, + "deprecated": false, "description": "An ini encoder/decoder for node", - "version": "1.3.5", + "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", + "tap": "14" + }, + "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" }, - "main": "ini.js", "scripts": { - "pretest": "standard ini.js", - "test": "tap test/*.js --100 -J", - "preversion": "npm test", + "eslint": "eslint", + "lint": "npm run eslint -- ini.js test/*.js", + "lintfix": "npm run lint -- --fix", + "posttest": "npm run lint", "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags" + "prepublishOnly": "git push origin --follow-tags", + "preversion": "npm test", + "test": "tap" }, - "engines": { - "node": "*" - }, - "dependencies": {}, - "devDependencies": { - "standard": "^10.0.3", - "tap": "^10.7.3 || 11" - }, - "license": "ISC", - "files": [ - "ini.js" - ] - -,"_resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz" -,"_integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" -,"_from": "ini@1.3.5" -} \ No newline at end of file + "version": "1.3.7" +} diff --git a/node_modules/nodemon/.jscsrc b/node_modules/nodemon/.jscsrc deleted file mode 100644 index 5ce64e0..0000000 --- a/node_modules/nodemon/.jscsrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "preset": "node-style-guide", - "requireCapitalizedComments": null, - "requireSpacesInAnonymousFunctionExpression": { - "beforeOpeningCurlyBrace": true, - "beforeOpeningRoundBrace": true - }, - "disallowSpacesInNamedFunctionExpression": { - "beforeOpeningRoundBrace": true - }, - "excludeFiles": ["node_modules/**"], - "disallowSpacesInFunction": null -} \ No newline at end of file diff --git a/node_modules/nodemon/.travis.yml b/node_modules/nodemon/.travis.yml index 9afab06..8057e91 100644 --- a/node_modules/nodemon/.travis.yml +++ b/node_modules/nodemon/.travis.yml @@ -5,10 +5,9 @@ cache: notifications: email: false node_js: + - '14' - '12' - - '11' - '10' - - '8' before_install: - if [ "$TRAVIS_PULL_REQUEST_BRANCH" == "" ]; then echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> .npmrc; fi after_success: diff --git a/node_modules/nodemon/bin/postinstall.js b/node_modules/nodemon/bin/postinstall.js index 70d2a25..210597c 100644 --- a/node_modules/nodemon/bin/postinstall.js +++ b/node_modules/nodemon/bin/postinstall.js @@ -1,7 +1,7 @@ #!/usr/bin/env node function main() { - if (process.env.SUPPRESS_SUPPORT) { + if (process.env.SUPPRESS_SUPPORT || process.env.OPENCOLLECTIVE_HIDE || process.env.CI) { return; } diff --git a/node_modules/nodemon/commitlint.config.js b/node_modules/nodemon/commitlint.config.js index 39955d6..84dcb12 100644 --- a/node_modules/nodemon/commitlint.config.js +++ b/node_modules/nodemon/commitlint.config.js @@ -1,7 +1,3 @@ module.exports = { - rules: { - 'body-tense': [0, 'never', 0], - lang: 'eng', - }, - extends: ['@commitlint/config-angular'], + extends: ['@commitlint/config-conventional'], }; diff --git a/node_modules/nodemon/lib/config/load.js b/node_modules/nodemon/lib/config/load.js index ddec54f..bd5a03d 100644 --- a/node_modules/nodemon/lib/config/load.js +++ b/node_modules/nodemon/lib/config/load.js @@ -74,7 +74,9 @@ function load(settings, options, config, callback) { } // if the script is found as a result of not being on the command // line, then we move any of the pre double-dash args in execArgs - const n = options.scriptPosition || options.args.length; + const n = options.scriptPosition === null ? + options.args.length : options.scriptPosition; + options.execArgs = (options.execArgs || []) .concat(options.args.splice(0, n)); options.scriptPosition = null; diff --git a/node_modules/nodemon/lib/monitor/match.js b/node_modules/nodemon/lib/monitor/match.js index 3261ced..2ac3b29 100644 --- a/node_modules/nodemon/lib/monitor/match.js +++ b/node_modules/nodemon/lib/monitor/match.js @@ -157,6 +157,12 @@ function match(files, monitor, ext) { if (s.indexOf('!' + cwd) === 0) { return s; } + + // if it starts with a period, then let's get the relative path + if (s.indexOf('!.') === 0) { + return '!' + path.resolve(cwd, s.substring(1)); + } + return '!**' + (prefix !== path.sep ? path.sep : '') + s.slice(1); } @@ -195,12 +201,13 @@ function match(files, monitor, ext) { for (var i = 0; i < rules.length; i++) { if (rules[i].slice(0, 1) === '!') { if (!minimatch(file, rules[i], minimatchOpts)) { + debug('ignored', file, 'rule:', rules[i]); ignored++; matched = true; break; } } else { - debug('match', file, minimatch(file, rules[i], minimatchOpts)); + debug('matched', file, 'rule:', rules[i]); if (minimatch(file, rules[i], minimatchOpts)) { watched++; diff --git a/node_modules/nodemon/lib/monitor/run.js b/node_modules/nodemon/lib/monitor/run.js index dce4638..5060378 100644 --- a/node_modules/nodemon/lib/monitor/run.js +++ b/node_modules/nodemon/lib/monitor/run.js @@ -18,16 +18,31 @@ var signals = require('./signals'); function run(options) { var cmd = config.command.raw; + // moved up + // we need restart function below in the global scope for run.kill + /*jshint validthis:true*/ + restart = run.bind(this, options); + run.restart = restart; + + // binding options with instance of run + // so that we can use it in run.kill + run.options = options; var runCmd = !options.runOnChangeOnly || config.lastStarted !== 0; if (runCmd) { utils.log.status('starting `' + config.command.string + '`'); + } else { + // should just watch file if command is not to be run + // had another alternate approach + // to stop process being forked/spawned in the below code + // but this approach does early exit and makes code cleaner + debug('start watch on: %s', config.options.watch); + if (config.options.watch !== false) { + watch(); + return; + } } - /*jshint validthis:true*/ - restart = run.bind(this, options); - run.restart = restart; - config.lastStarted = Date.now(); var stdio = ['pipe', 'pipe', 'pipe']; @@ -97,6 +112,8 @@ function run(options) { utils.version.major > 4 // only fork if node version > 4 if (shouldFork) { + // this assumes the first argument is the script and slices it out, since + // we're forking var forkArgs = cmd.args.slice(1); var env = utils.merge(options.execOptions.env, process.env); stdio.push('ipc'); @@ -235,53 +252,9 @@ function run(options) { } }); - run.kill = function (noRestart, callback) { - // I hate code like this :( - Remy (author of said code) - if (typeof noRestart === 'function') { - callback = noRestart; - noRestart = false; - } - - if (!callback) { - callback = noop; - } - - if (child !== null) { - // if the stdin piping is on, we need to unpipe, but also close stdin on - // the child, otherwise linux can throw EPIPE or ECONNRESET errors. - if (options.stdin) { - process.stdin.unpipe(child.stdin); - } - - // For the on('exit', ...) handler above the following looks like a - // crash, so we set the killedAfterChange flag if a restart is planned - if (!noRestart) { - killedAfterChange = true; - } - - /* Now kill the entire subtree of processes belonging to nodemon */ - var oldPid = child.pid; - if (child) { - kill(child, config.signal, function () { - // this seems to fix the 0.11.x issue with the "rs" restart command, - // though I'm unsure why. it seems like more data is streamed in to - // stdin after we close. - if (child && options.stdin && child.stdin && oldPid === child.pid) { - child.stdin.end(); - } - callback(); - }); - } - } else if (!noRestart) { - // if there's no child, then we need to manually start the process - // this is because as there was no child, the child.on('exit') event - // handler doesn't exist which would normally trigger the restart. - bus.once('start', callback); - restart(); - } else { - callback(); - } - }; + // moved the run.kill outside to handle both the cases + // intial start + // no start // connect stdin to the child process (options.stdin is on by default) if (options.stdin) { @@ -379,12 +352,54 @@ function kill(child, signal, callback) { } } -// stubbed out for now, filled in during run -run.kill = function (flag, callback) { - if (callback) { +run.kill = function (noRestart, callback) { + // I hate code like this :( - Remy (author of said code) + if (typeof noRestart === 'function') { + callback = noRestart; + noRestart = false; + } + + if (!callback) { + callback = noop; + } + + if (child !== null) { + // if the stdin piping is on, we need to unpipe, but also close stdin on + // the child, otherwise linux can throw EPIPE or ECONNRESET errors. + if (run.options.stdin) { + process.stdin.unpipe(child.stdin); + } + + // For the on('exit', ...) handler above the following looks like a + // crash, so we set the killedAfterChange flag if a restart is planned + if (!noRestart) { + killedAfterChange = true; + } + + /* Now kill the entire subtree of processes belonging to nodemon */ + var oldPid = child.pid; + if (child) { + kill(child, config.signal, function () { + // this seems to fix the 0.11.x issue with the "rs" restart command, + // though I'm unsure why. it seems like more data is streamed in to + // stdin after we close. + if (child && run.options.stdin && child.stdin && oldPid === child.pid) { + child.stdin.end(); + } + callback(); + }); + } + } else if (!noRestart) { + // if there's no child, then we need to manually start the process + // this is because as there was no child, the child.on('exit') event + // handler doesn't exist which would normally trigger the restart. + bus.once('start', callback); + run.restart(); + } else { callback(); } }; + run.restart = noop; bus.on('quit', function onQuit(code) { diff --git a/node_modules/nodemon/lib/monitor/watch.js b/node_modules/nodemon/lib/monitor/watch.js index be77c29..1ef1408 100644 --- a/node_modules/nodemon/lib/monitor/watch.js +++ b/node_modules/nodemon/lib/monitor/watch.js @@ -177,7 +177,7 @@ function filterAndRestart(files) { // if there's no matches, then test to see if the changed file is the // running script, if so, let's allow a restart - if (config.options.execOptions.script) { + if (config.options.execOptions && config.options.execOptions.script) { const script = path.resolve(config.options.execOptions.script); if (matched.result.length === 0 && script) { const length = script.length; diff --git a/node_modules/nodemon/lib/nodemon.js b/node_modules/nodemon/lib/nodemon.js index b3badea..ce649cb 100644 --- a/node_modules/nodemon/lib/nodemon.js +++ b/node_modules/nodemon/lib/nodemon.js @@ -39,7 +39,9 @@ function nodemon(settings) { } if (settings.help) { - process.stdout._handle.setBlocking(true); // nodejs/node#6456 + if (process.stdout.isTTY) { + process.stdout._handle.setBlocking(true); // nodejs/node#6456 + } console.log(help(settings.help)); if (!config.required) { process.exit(0); diff --git a/node_modules/nodemon/node_modules/debug/dist/debug.js b/node_modules/nodemon/node_modules/debug/dist/debug.js deleted file mode 100644 index f271e01..0000000 --- a/node_modules/nodemon/node_modules/debug/dist/debug.js +++ /dev/null @@ -1,886 +0,0 @@ -"use strict"; - -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -(function (f) { - if ((typeof exports === "undefined" ? "undefined" : _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.debug = 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 < t.length; i++) { - o(t[i]); - } - - return o; - } - - return r; - }()({ - 1: [function (require, module, exports) { - /** - * Helpers. - */ - var s = 1000; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - /** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - - module.exports = function (val, options) { - options = options || {}; - - var type = _typeof(val); - - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isNaN(val) === false) { - return options.long ? fmtLong(val) : fmtShort(val); - } - - throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); - }; - /** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - - - function parse(str) { - str = String(str); - - if (str.length > 100) { - return; - } - - var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); - - if (!match) { - return; - } - - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - - case 'weeks': - case 'week': - case 'w': - return n * w; - - case 'days': - case 'day': - case 'd': - return n * d; - - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - - default: - return undefined; - } - } - /** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - - - function fmtShort(ms) { - var msAbs = Math.abs(ms); - - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - - return ms + 'ms'; - } - /** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - - - function fmtLong(ms) { - var msAbs = Math.abs(ms); - - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - - return ms + ' ms'; - } - /** - * Pluralization helper. - */ - - - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); - } - }, {}], - 2: [function (require, module, exports) { - // shim for using process in browser - var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it - // don't break things. But we need to wrap it in a try catch in case it is - // wrapped in strict mode code which doesn't define any globals. It's inside a - // function because try/catches deoptimize in certain engines. - - var cachedSetTimeout; - var cachedClearTimeout; - - function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); - } - - function defaultClearTimeout() { - throw new Error('clearTimeout has not been defined'); - } - - (function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } - })(); - - function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } // if setTimeout wasn't available but was latter defined - - - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - } - - function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } // if clearTimeout wasn't available but was latter defined - - - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - } - - var queue = []; - var draining = false; - var currentQueue; - var queueIndex = -1; - - function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - - draining = false; - - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - - if (queue.length) { - drainQueue(); - } - } - - function drainQueue() { - if (draining) { - return; - } - - var timeout = runTimeout(cleanUpNextTick); - draining = true; - var len = queue.length; - - while (len) { - currentQueue = queue; - queue = []; - - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - - queueIndex = -1; - len = queue.length; - } - - currentQueue = null; - draining = false; - runClearTimeout(timeout); - } - - process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - - queue.push(new Item(fun, args)); - - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } - }; // v8 likes predictible objects - - - function Item(fun, array) { - this.fun = fun; - this.array = array; - } - - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - - process.title = 'browser'; - process.browser = true; - process.env = {}; - process.argv = []; - process.version = ''; // empty string to avoid regexp issues - - process.versions = {}; - - function noop() {} - - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; - process.prependListener = noop; - process.prependOnceListener = noop; - - process.listeners = function (name) { - return []; - }; - - process.binding = function (name) { - throw new Error('process.binding is not supported'); - }; - - process.cwd = function () { - return '/'; - }; - - process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); - }; - - process.umask = function () { - return 0; - }; - }, {}], - 3: [function (require, module, exports) { - /** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ - function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require('ms'); - Object.keys(env).forEach(function (key) { - createDebug[key] = env[key]; - }); - /** - * Active `debug` instances. - */ - - createDebug.instances = []; - /** - * The currently active debug mode names, and names to skip. - */ - - createDebug.names = []; - createDebug.skips = []; - /** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - - createDebug.formatters = {}; - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - - function selectColor(namespace) { - var hash = 0; - - for (var i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } - - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - - createDebug.selectColor = selectColor; - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - - function createDebug(namespace) { - var prevTime; - - function debug() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - // Disabled? - if (!debug.enabled) { - return; - } - - var self = debug; // Set `diff` timestamp - - var curr = Number(new Date()); - var ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - args[0] = createDebug.coerce(args[0]); - - if (typeof args[0] !== 'string') { - // Anything else let's inspect with %O - args.unshift('%O'); - } // Apply any `formatters` transformations - - - var index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return match; - } - - index++; - var formatter = createDebug.formatters[format]; - - if (typeof formatter === 'function') { - var val = args[index]; - match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` - - args.splice(index, 1); - index--; - } - - return match; - }); // Apply env-specific formatting (colors, etc.) - - createDebug.formatArgs.call(self, args); - var logFn = self.log || createDebug.log; - logFn.apply(self, args); - } - - debug.namespace = namespace; - debug.enabled = createDebug.enabled(namespace); - debug.useColors = createDebug.useColors(); - debug.color = selectColor(namespace); - debug.destroy = destroy; - debug.extend = extend; // Debug.formatArgs = formatArgs; - // debug.rawLog = rawLog; - // env-specific initialization logic for debug instances - - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } - - createDebug.instances.push(debug); - return debug; - } - - function destroy() { - var index = createDebug.instances.indexOf(this); - - if (index !== -1) { - createDebug.instances.splice(index, 1); - return true; - } - - return false; - } - - function extend(namespace, delimiter) { - return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - } - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - - - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.names = []; - createDebug.skips = []; - var i; - var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - var len = split.length; - - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; - } - - namespaces = split[i].replace(/\*/g, '.*?'); - - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); - } - } - - for (i = 0; i < createDebug.instances.length; i++) { - var instance = createDebug.instances[i]; - instance.enabled = createDebug.enabled(instance.namespace); - } - } - /** - * Disable debug output. - * - * @api public - */ - - - function disable() { - createDebug.enable(''); - } - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - - - function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } - - var i; - var len; - - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } - - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } - - return false; - } - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - - - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - - return val; - } - - createDebug.enable(createDebug.load()); - return createDebug; - } - - module.exports = setup; - }, { - "ms": 1 - }], - 4: [function (require, module, exports) { - (function (process) { - /* eslint-env browser */ - - /** - * This is the web browser implementation of `debug()`. - */ - exports.log = log; - exports.formatArgs = formatArgs; - exports.save = save; - exports.load = load; - exports.useColors = useColors; - exports.storage = localstorage(); - /** - * Colors. - */ - - exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; - /** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - // eslint-disable-next-line complexity - - function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { - return true; - } // Internet Explorer and Edge do not support colors. - - - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } // Is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - - - return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 - typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker - typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); - } - /** - * Colorize log arguments if enabled. - * - * @api public - */ - - - function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); - - if (!this.useColors) { - return; - } - - var c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - - var index = 0; - var lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, function (match) { - if (match === '%%') { - return; - } - - index++; - - if (match === '%c') { - // We only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - args.splice(lastC, 0, c); - } - /** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". - * - * @api public - */ - - - function log() { - var _console; - - // This hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); - } - /** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - - - function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) {// Swallow - // XXX (@Qix-) should we be logging these? - } - } - /** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - - - function load() { - var r; - - try { - r = exports.storage.getItem('debug'); - } catch (error) {} // Swallow - // XXX (@Qix-) should we be logging these? - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - - - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } - - return r; - } - /** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - - - function localstorage() { - try { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) {// Swallow - // XXX (@Qix-) should we be logging these? - } - } - - module.exports = require('./common')(exports); - var formatters = module.exports.formatters; - /** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - - formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; - } - }; - }).call(this, require('_process')); - }, { - "./common": 3, - "_process": 2 - }] - }, {}, [4])(4); -}); - diff --git a/node_modules/nodemon/node_modules/debug/package.json b/node_modules/nodemon/node_modules/debug/package.json index f77fe3d..0aeb31f 100644 --- a/node_modules/nodemon/node_modules/debug/package.json +++ b/node_modules/nodemon/node_modules/debug/package.json @@ -1,32 +1,52 @@ { - "name": "debug", - "version": "3.2.6", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" + "_from": "debug@^3.2.6", + "_id": "debug@3.2.7", + "_inBundle": false, + "_integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "_location": "/nodemon/debug", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "debug@^3.2.6", + "name": "debug", + "escapedName": "debug", + "rawSpec": "^3.2.6", + "saveSpec": null, + "fetchSpec": "^3.2.6" }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" + "_requiredBy": [ + "/nodemon" ], - "files": [ - "src", - "node.js", - "dist/debug.js", - "LICENSE", - "README.md" - ], - "author": "TJ Holowaychuk ", + "_resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "_shasum": "72580b7e9145fb39b6676f9c5e5fb100b934179a", + "_spec": "debug@^3.2.6", + "_where": "C:\\Users\\Jonasz\\Desktop\\Menui\\menui_backend\\node_modules\\nodemon", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "browser": "./src/browser.js", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "bundleDependencies": false, "contributors": [ - "Nathan Rajlich (http://n8.io)", - "Andrew Rhyne " + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io" + }, + { + "name": "Andrew Rhyne", + "email": "rhyneandrew@gmail.com" + } ], - "license": "MIT", "dependencies": { "ms": "^2.1.1" }, + "deprecated": false, + "description": "small debugging utility", "devDependencies": { "@babel/cli": "^7.0.0", "@babel/core": "^7.0.0", @@ -45,11 +65,26 @@ "rimraf": "^2.5.4", "xo": "^0.23.0" }, + "files": [ + "src", + "node.js", + "dist/debug.js", + "LICENSE", + "README.md" + ], + "homepage": "https://github.com/visionmedia/debug#readme", + "keywords": [ + "debug", + "log", + "debugger" + ], + "license": "MIT", "main": "./src/index.js", - "browser": "./src/browser.js", - "unpkg": "./dist/debug.js" - -,"_resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz" -,"_integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==" -,"_from": "debug@3.2.6" -} \ No newline at end of file + "name": "debug", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "unpkg": "./dist/debug.js", + "version": "3.2.7" +} diff --git a/node_modules/nodemon/node_modules/debug/src/node.js b/node_modules/nodemon/node_modules/debug/src/node.js index dbbb5f1..1e6a5f1 100644 --- a/node_modules/nodemon/node_modules/debug/src/node.js +++ b/node_modules/nodemon/node_modules/debug/src/node.js @@ -160,7 +160,10 @@ var formatters = module.exports.formatters; formatters.o = function (v) { this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).replace(/\s*\n\s*/g, ' '); + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(function (str) { return str.trim(); }) + .join(' '); }; /** * Map %O to `util.inspect()`, allowing multiple lines if needed. diff --git a/node_modules/nodemon/node_modules/ms/index.js b/node_modules/nodemon/node_modules/ms/index.js index c4498bc..ea734fb 100644 --- a/node_modules/nodemon/node_modules/ms/index.js +++ b/node_modules/nodemon/node_modules/ms/index.js @@ -23,7 +23,7 @@ var y = d * 365.25; * @api public */ -module.exports = function(val, options) { +module.exports = function (val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { diff --git a/node_modules/nodemon/node_modules/ms/license.md b/node_modules/nodemon/node_modules/ms/license.md index 69b6125..fa5d39b 100644 --- a/node_modules/nodemon/node_modules/ms/license.md +++ b/node_modules/nodemon/node_modules/ms/license.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Zeit, Inc. +Copyright (c) 2020 Vercel, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/nodemon/node_modules/ms/package.json b/node_modules/nodemon/node_modules/ms/package.json index e286ef2..451011c 100644 --- a/node_modules/nodemon/node_modules/ms/package.json +++ b/node_modules/nodemon/node_modules/ms/package.json @@ -1,16 +1,40 @@ { - "name": "ms", - "version": "2.1.2", - "description": "Tiny millisecond conversion utility", - "repository": "zeit/ms", - "main": "./index", - "files": [ - "index.js" + "_from": "ms@^2.1.1", + "_id": "ms@2.1.3", + "_inBundle": false, + "_integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "_location": "/nodemon/ms", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ms@^2.1.1", + "name": "ms", + "escapedName": "ms", + "rawSpec": "^2.1.1", + "saveSpec": null, + "fetchSpec": "^2.1.1" + }, + "_requiredBy": [ + "/nodemon/debug" ], - "scripts": { - "precommit": "lint-staged", - "lint": "eslint lib/* bin/*", - "test": "mocha tests.js" + "_resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "_shasum": "574c8138ce1d2b5861f0b44579dbadd60c6615b2", + "_spec": "ms@^2.1.1", + "_where": "C:\\Users\\Jonasz\\Desktop\\Menui\\menui_backend\\node_modules\\nodemon\\node_modules\\debug", + "bugs": { + "url": "https://github.com/vercel/ms/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Tiny millisecond conversion utility", + "devDependencies": { + "eslint": "4.18.2", + "expect.js": "0.3.1", + "husky": "0.14.3", + "lint-staged": "5.0.0", + "mocha": "4.0.1", + "prettier": "2.0.5" }, "eslintConfig": { "extends": "eslint:recommended", @@ -19,6 +43,11 @@ "es6": true } }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/vercel/ms#readme", + "license": "MIT", "lint-staged": { "*.js": [ "npm run lint", @@ -26,16 +55,16 @@ "git add" ] }, - "license": "MIT", - "devDependencies": { - "eslint": "4.12.1", - "expect.js": "0.3.1", - "husky": "0.14.3", - "lint-staged": "5.0.0", - "mocha": "4.0.1" - } - -,"_resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" -,"_integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" -,"_from": "ms@2.1.2" -} \ No newline at end of file + "main": "./index", + "name": "ms", + "repository": { + "type": "git", + "url": "git+https://github.com/vercel/ms.git" + }, + "scripts": { + "lint": "eslint lib/* bin/*", + "precommit": "lint-staged", + "test": "mocha tests.js" + }, + "version": "2.1.3" +} diff --git a/node_modules/nodemon/node_modules/ms/readme.md b/node_modules/nodemon/node_modules/ms/readme.md index 9a1996b..0fc1abb 100644 --- a/node_modules/nodemon/node_modules/ms/readme.md +++ b/node_modules/nodemon/node_modules/ms/readme.md @@ -1,7 +1,6 @@ # ms -[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) -[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/zeit) +![CI](https://github.com/vercel/ms/workflows/CI/badge.svg) Use this package to easily convert various time formats to milliseconds. diff --git a/node_modules/nodemon/package.json b/node_modules/nodemon/package.json index 1953a44..3395ec7 100644 --- a/node_modules/nodemon/package.json +++ b/node_modules/nodemon/package.json @@ -1,5 +1,103 @@ -{"name":"nodemon","homepage":"http://nodemon.io","author":{"name":"Remy Sharp","url":"http://github.com/remy"},"bin":{"nodemon":"./bin/nodemon.js"},"engines":{"node":">=8.10.0"},"repository":{"type":"git","url":"https://github.com/remy/nodemon.git"},"description":"Simple monitor script for use during development of a node.js app.","keywords":["monitor","development","restart","autoload","reload","terminal"],"license":"MIT","main":"./lib/nodemon","scripts":{"commitmsg":"commitlint -e","coverage":"istanbul cover _mocha -- --timeout 30000 --ui bdd --reporter list test/**/*.test.js","lint":"jscs lib/**/*.js -v",":spec":"node_modules/.bin/mocha --timeout 30000 --ui bdd test/**/*.test.js","test":"npm run lint && npm run spec","spec":"for FILE in test/**/*.test.js; do echo $FILE; TEST=1 mocha --exit --timeout 30000 $FILE; if [ $? -ne 0 ]; then exit 1; fi; sleep 1; done","postspec":"npm run clean","clean":"rm -rf test/fixtures/test*.js test/fixtures/test*.md","web":"node web","semantic-release":"semantic-release pre && npm publish && semantic-release post","prepush":"npm run lint","killall":"ps auxww | grep node | grep -v grep | awk '{ print $2 }' | xargs kill -9","postinstall":"node bin/postinstall || exit 0"},"devDependencies":{"@commitlint/cli":"^3.1.3","@commitlint/config-angular":"^3.1.1","async":"1.4.2","coffee-script":"~1.7.1","husky":"^0.14.3","istanbul":"^0.4.5","jscs":"^3.0.7","mocha":"^2.5.3","proxyquire":"^1.8.0","semantic-release":"^8.2.3","should":"~4.0.0"},"dependencies":{"chokidar":"^3.2.2","debug":"^3.2.6","ignore-by-default":"^1.0.1","minimatch":"^3.0.4","pstree.remy":"^1.1.7","semver":"^5.7.1","supports-color":"^5.5.0","touch":"^3.1.0","undefsafe":"^2.0.2","update-notifier":"^4.0.0"},"version":"2.0.4","funding":{"type":"opencollective","url":"https://opencollective.com/nodemon"} -,"_resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.4.tgz" -,"_integrity": "sha512-Ltced+hIfTmaS28Zjv1BM552oQ3dbwPqI4+zI0SLgq+wpJhSyqgYude/aZa/3i31VCQWMfXJVxvu86abcam3uQ==" -,"_from": "nodemon@2.0.4" -} \ No newline at end of file +{ + "_from": "nodemon@^2.0.4", + "_id": "nodemon@2.0.7", + "_inBundle": false, + "_integrity": "sha512-XHzK69Awgnec9UzHr1kc8EomQh4sjTQ8oRf8TsGrSmHDx9/UmiGG9E/mM3BuTfNeFwdNBvrqQq/RHL0xIeyFOA==", + "_location": "/nodemon", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "nodemon@^2.0.4", + "name": "nodemon", + "escapedName": "nodemon", + "rawSpec": "^2.0.4", + "saveSpec": null, + "fetchSpec": "^2.0.4" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.7.tgz", + "_shasum": "6f030a0a0ebe3ea1ba2a38f71bf9bab4841ced32", + "_spec": "nodemon@^2.0.4", + "_where": "C:\\Users\\Jonasz\\Desktop\\Menui\\menui_backend", + "author": { + "name": "Remy Sharp", + "url": "https://github.com/remy" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "bugs": { + "url": "https://github.com/remy/nodemon/issues" + }, + "bundleDependencies": false, + "dependencies": { + "chokidar": "^3.2.2", + "debug": "^3.2.6", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.0.4", + "pstree.remy": "^1.1.7", + "semver": "^5.7.1", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.3", + "update-notifier": "^4.1.0" + }, + "deprecated": false, + "description": "Simple monitor script for use during development of a node.js app.", + "devDependencies": { + "@commitlint/cli": "^11.0.0", + "@commitlint/config-conventional": "^11.0.0", + "async": "1.4.2", + "coffee-script": "~1.7.1", + "eslint": "^7.11.0", + "husky": "^0.14.3", + "istanbul": "^0.4.5", + "mocha": "^2.5.3", + "proxyquire": "^1.8.0", + "semantic-release": "^8.2.3", + "should": "~4.0.0" + }, + "engines": { + "node": ">=8.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + }, + "homepage": "https://nodemon.io", + "keywords": [ + "monitor", + "development", + "restart", + "autoload", + "reload", + "terminal" + ], + "license": "MIT", + "main": "./lib/nodemon", + "name": "nodemon", + "repository": { + "type": "git", + "url": "git+https://github.com/remy/nodemon.git" + }, + "scripts": { + ":spec": "mocha --timeout 30000 --ui bdd test/**/*.test.js", + "clean": "rm -rf test/fixtures/test*.js test/fixtures/test*.md", + "commitmsg": "commitlint -e", + "coverage": "istanbul cover _mocha -- --timeout 30000 --ui bdd --reporter list test/**/*.test.js", + "killall": "ps auxww | grep node | grep -v grep | awk '{ print $2 }' | xargs kill -9", + "lint": "eslint lib/**/*.js", + "postinstall": "node bin/postinstall || exit 0", + "postspec": "npm run clean", + "prepush": "npm run lint", + "semantic-release": "semantic-release pre && npm publish && semantic-release post", + "spec": "for FILE in test/**/*.test.js; do echo $FILE; TEST=1 mocha --exit --timeout 30000 $FILE; if [ $? -ne 0 ]; then exit 1; fi; sleep 1; done", + "test": "npm run lint && npm run spec", + "web": "node web" + }, + "version": "2.0.7" +} diff --git a/node_modules/pupa/index.js b/node_modules/pupa/index.js index c8dc040..85739eb 100644 --- a/node_modules/pupa/index.js +++ b/node_modules/pupa/index.js @@ -10,7 +10,8 @@ module.exports = (template, data) => { throw new TypeError(`Expected an \`object\` or \`Array\` in the second argument, got \`${typeof data}\``); } - const doubleBraceRegex = /{{(.*?)}}/g; + // The regex tries to match either a number inside `{{ }}` or a valid JS identifier or key path. + const doubleBraceRegex = /{{(\d+|[a-z$_][a-z\d$_]*?(?:\.[a-z\d$_]*?)*?)}}/gi; if (doubleBraceRegex.test(template)) { template = template.replace(doubleBraceRegex, (_, key) => { @@ -24,7 +25,7 @@ module.exports = (template, data) => { }); } - const braceRegex = /{(.*?)}/g; + const braceRegex = /{(\d+|[a-z$_][a-z\d$_]*?(?:\.[a-z\d$_]*?)*?)}/gi; return template.replace(braceRegex, (_, key) => { let result = data; diff --git a/node_modules/pupa/package.json b/node_modules/pupa/package.json index c8d005b..4e8621f 100644 --- a/node_modules/pupa/package.json +++ b/node_modules/pupa/package.json @@ -1,51 +1,79 @@ { - "name": "pupa", - "version": "2.0.1", - "description": "Simple micro templating", - "license": "MIT", - "repository": "sindresorhus/pupa", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "string", - "formatting", - "template", - "object", - "format", - "interpolate", - "interpolation", - "templating", - "expand", - "simple", - "replace", - "placeholders", - "values", - "transform", - "micro" - ], - "dependencies": { - "escape-goat": "^2.0.0" - }, - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } - -,"_resolved": "https://registry.npmjs.org/pupa/-/pupa-2.0.1.tgz" -,"_integrity": "sha512-hEJH0s8PXLY/cdXh66tNEQGndDrIKNqNC5xmrysZy3i5C3oEoLna7YAOad+7u125+zH1HNXUmGEkrhb3c2VriA==" -,"_from": "pupa@2.0.1" -} \ No newline at end of file + "_from": "pupa@^2.0.1", + "_id": "pupa@2.1.1", + "_inBundle": false, + "_integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", + "_location": "/pupa", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pupa@^2.0.1", + "name": "pupa", + "escapedName": "pupa", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/update-notifier" + ], + "_resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", + "_shasum": "f5e8fd4afc2c5d97828faa523549ed8744a20d62", + "_spec": "pupa@^2.0.1", + "_where": "C:\\Users\\Jonasz\\Desktop\\Menui\\menui_backend\\node_modules\\update-notifier", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/pupa/issues" + }, + "bundleDependencies": false, + "dependencies": { + "escape-goat": "^2.0.0" + }, + "deprecated": false, + "description": "Simple micro templating", + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/sindresorhus/pupa#readme", + "keywords": [ + "string", + "formatting", + "template", + "object", + "format", + "interpolate", + "interpolation", + "templating", + "expand", + "simple", + "replace", + "placeholders", + "values", + "transform", + "micro" + ], + "license": "MIT", + "name": "pupa", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/pupa.git" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "version": "2.1.1" +} diff --git a/node_modules/readdirp/README.md b/node_modules/readdirp/README.md index b3b3127..465593c 100644 --- a/node_modules/readdirp/README.md +++ b/node_modules/readdirp/README.md @@ -1,8 +1,7 @@ # readdirp [![Weekly downloads](https://img.shields.io/npm/dw/readdirp.svg)](https://github.com/paulmillr/readdirp) -> Recursive version of [fs.readdir](https://nodejs.org/api/fs.html#fs_fs_readdir_path_options_callback). Exposes a **stream API** and a **promise API**. +Recursive version of [fs.readdir](https://nodejs.org/api/fs.html#fs_fs_readdir_path_options_callback). Exposes a **stream API** and a **promise API**. -[![NPM](https://nodei.co/npm/readdirp.png)](https://www.npmjs.com/package/readdirp) ```sh npm install readdirp @@ -79,7 +78,7 @@ First argument is awalys `root`, path in which to start reading and recursing in - `directoryFilter: ['!.git']`: filter to include/exclude directories found and to recurse into. Directories that do not pass a filter will not be recursed into. - `depth: 5`: depth at which to stop recursing even if more subdirectories are found - `type: 'files'`: determines if data events on the stream should be emitted for `'files'` (default), `'directories'`, `'files_directories'`, or `'all'`. Setting to `'all'` will also include entries for other types of file descriptors like character devices, unix sockets and named pipes. -- `alwaysStat: false`: always return `stats` property for every file. Setting it to `true` can double readdir execution time - use it only when you need file `size`, `mtime` etc. Cannot be enabled on node <10.10.0. +- `alwaysStat: false`: always return `stats` property for every file. Default is `false`, readdirp will return `Dirent` entries. Setting it to `true` can double readdir execution time - use it only when you need file `size`, `mtime` etc. Cannot be enabled on node <10.10.0. - `lstat: false`: include symlink entries in the stream along with files. When `true`, `fs.lstat` would be used instead of `fs.stat` ### `EntryInfo` @@ -94,6 +93,9 @@ Has the following properties: ## Changelog +- 3.5 (Oct 13, 2020) disallows recursive directory-based symlinks. + Before, it could have entered infinite loop. +- 3.4 (Mar 19, 2020) adds support for directory-based symlinks. - 3.3 (Dec 6, 2019) stabilizes RAM consumption and enables perf management with `highWaterMark` option. Fixes race conditions related to `for-await` looping. - 3.2 (Oct 14, 2019) improves performance by 250% and makes streams implementation more idiomatic. - 3.1 (Jul 7, 2019) brings `bigint` support to `stat` output on Windows. This is backwards-incompatible for some cases. Be careful. It you use it incorrectly, you'll see "TypeError: Cannot mix BigInt and other types, use explicit conversions". diff --git a/node_modules/readdirp/index.js b/node_modules/readdirp/index.js index 09ba382..30df947 100644 --- a/node_modules/readdirp/index.js +++ b/node_modules/readdirp/index.js @@ -204,13 +204,20 @@ class ReaddirpStream extends Readable { return 'directory'; } if (stats && stats.isSymbolicLink()) { + const full = entry.fullPath; try { - const entryRealPath = await realpath(entry.fullPath); + const entryRealPath = await realpath(full); const entryRealPathStats = await lstat(entryRealPath); if (entryRealPathStats.isFile()) { return 'file'; } if (entryRealPathStats.isDirectory()) { + const len = entryRealPath.length; + if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) { + return this._onError(new Error( + `Circular symlink detected: "${full}" points to "${entryRealPath}"` + )); + } return 'directory'; } } catch (error) { diff --git a/node_modules/readdirp/package.json b/node_modules/readdirp/package.json index ff5319e..1461cdc 100644 --- a/node_modules/readdirp/package.json +++ b/node_modules/readdirp/package.json @@ -1,64 +1,65 @@ { - "name": "readdirp", - "description": "Recursive version of fs.readdir with streaming API.", - "version": "3.4.0", - "homepage": "https://github.com/paulmillr/readdirp", - "repository": { - "type": "git", - "url": "git://github.com/paulmillr/readdirp.git" + "_from": "readdirp@~3.5.0", + "_id": "readdirp@3.5.0", + "_inBundle": false, + "_integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "_location": "/readdirp", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "readdirp@~3.5.0", + "name": "readdirp", + "escapedName": "readdirp", + "rawSpec": "~3.5.0", + "saveSpec": null, + "fetchSpec": "~3.5.0" + }, + "_requiredBy": [ + "/chokidar" + ], + "_resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", + "_shasum": "9ba74c019b15d365278d2e91bb8c48d7b4d42c9e", + "_spec": "readdirp@~3.5.0", + "_where": "C:\\Users\\Jonasz\\Desktop\\Menui\\menui_backend\\node_modules\\chokidar", + "author": { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "thlorenz.com" }, - "license": "MIT", "bugs": { "url": "https://github.com/paulmillr/readdirp/issues" }, - "author": "Thorsten Lorenz (thlorenz.com)", + "bundleDependencies": false, "contributors": [ - "Thorsten Lorenz (thlorenz.com)", - "Paul Miller (https://paulmillr.com)" + { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "thlorenz.com" + }, + { + "name": "Paul Miller", + "url": "https://paulmillr.com" + } ], - "main": "index.js", - "engines": { - "node": ">=8.10.0" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "recursive", - "fs", - "stream", - "streams", - "readdir", - "filesystem", - "find", - "filter" - ], - "scripts": { - "dtslint": "dtslint", - "nyc": "nyc", - "mocha": "mocha --exit", - "lint": "eslint --report-unused-disable-directives --ignore-path .gitignore .", - "test": "npm run lint && nyc npm run mocha" - }, "dependencies": { "picomatch": "^2.2.1" }, + "deprecated": false, + "description": "Recursive version of fs.readdir with streaming API.", "devDependencies": { - "@types/node": "^13", + "@types/node": "^14", "chai": "^4.2", "chai-subset": "^1.6", "dtslint": "^3.3.0", - "eslint": "^6.6.0", + "eslint": "^7.0.0", "mocha": "^7.1.1", "nyc": "^15.0.0", - "rimraf": "^3.0.0" + "rimraf": "^3.0.0", + "typescript": "^4.0.3" }, - "nyc": { - "reporter": [ - "html", - "text" - ] + "engines": { + "node": ">=8.10.0" }, "eslintConfig": { "root": true, @@ -117,9 +118,41 @@ "single" ] } - } - -,"_resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz" -,"_integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==" -,"_from": "readdirp@3.4.0" -} \ No newline at end of file + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/paulmillr/readdirp", + "keywords": [ + "recursive", + "fs", + "stream", + "streams", + "readdir", + "filesystem", + "find", + "filter" + ], + "license": "MIT", + "main": "index.js", + "name": "readdirp", + "nyc": { + "reporter": [ + "html", + "text" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/paulmillr/readdirp.git" + }, + "scripts": { + "dtslint": "dtslint", + "lint": "eslint --report-unused-disable-directives --ignore-path .gitignore .", + "mocha": "mocha --exit", + "nyc": "nyc", + "test": "npm run lint && nyc npm run mocha" + }, + "version": "3.5.0" +} diff --git a/node_modules/registry-auth-token/CHANGELOG.md b/node_modules/registry-auth-token/CHANGELOG.md index 79b5f42..e96f146 100644 --- a/node_modules/registry-auth-token/CHANGELOG.md +++ b/node_modules/registry-auth-token/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes will be documented in this file. +## [4.2.0] - 2020-07-13 + +### Changes + +- Add support for `NPM_CONFIG_USERCONFIG` environment variable (Ben Sorohan) + ## [4.1.0] - 2020-01-17 ### Changes diff --git a/node_modules/registry-auth-token/README.md b/node_modules/registry-auth-token/README.md index 5ac9c1a..084dc0a 100644 --- a/node_modules/registry-auth-token/README.md +++ b/node_modules/registry-auth-token/README.md @@ -1,6 +1,6 @@ # 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) +[![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/main.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. diff --git a/node_modules/registry-auth-token/index.js b/node_modules/registry-auth-token/index.js index 208b527..28eedfd 100644 --- a/node_modules/registry-auth-token/index.js +++ b/node_modules/registry-auth-token/index.js @@ -21,7 +21,9 @@ module.exports = function () { options = arguments[0] } options = options || {} - options.npmrc = options.npmrc || require('rc')('npm', { registry: 'https://registry.npmjs.org/' }) + options.npmrc = options.npmrc || require('rc')('npm', { registry: 'https://registry.npmjs.org/' }, { + config: process.env.npm_config_userconfig || process.env.NPM_CONFIG_USERCONFIG + }) checkUrl = checkUrl || options.npmrc.registry return getRegistryAuthInfo(checkUrl, options) || getLegacyAuthInfo(options.npmrc) } diff --git a/node_modules/registry-auth-token/package.json b/node_modules/registry-auth-token/package.json index 34f0388..bd0f716 100644 --- a/node_modules/registry-auth-token/package.json +++ b/node_modules/registry-auth-token/package.json @@ -1,20 +1,50 @@ { - "name": "registry-auth-token", - "version": "4.1.1", - "description": "Get the auth token set for an npm registry (if any)", - "main": "index.js", - "scripts": { - "test": "mocha", - "posttest": "standard", - "coverage": "istanbul cover _mocha" + "_from": "registry-auth-token@^4.0.0", + "_id": "registry-auth-token@4.2.1", + "_inBundle": false, + "_integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", + "_location": "/registry-auth-token", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "registry-auth-token@^4.0.0", + "name": "registry-auth-token", + "escapedName": "registry-auth-token", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/rexxars/registry-auth-token.git" + "_requiredBy": [ + "/package-json" + ], + "_resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", + "_shasum": "6d7b4006441918972ccd5fedcd41dc322c79b250", + "_spec": "registry-auth-token@^4.0.0", + "_where": "C:\\Users\\Jonasz\\Desktop\\Menui\\menui_backend\\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.2.8" + }, + "deprecated": false, + "description": "Get the auth token set for an npm registry (if any)", + "devDependencies": { + "istanbul": "^0.4.2", + "mocha": "^6.1.4", + "require-uncached": "^1.0.2", + "standard": "^12.0.1" }, "engines": { "node": ">=6.0.0" }, + "homepage": "https://github.com/rexxars/registry-auth-token#readme", "keywords": [ "npm", "conf", @@ -25,28 +55,22 @@ "token", "authtoken" ], - "author": "Espen Hovlandsdal ", "license": "MIT", - "bugs": { - "url": "https://github.com/rexxars/registry-auth-token/issues" + "main": "index.js", + "name": "registry-auth-token", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/rexxars/registry-auth-token.git" }, - "homepage": "https://github.com/rexxars/registry-auth-token#readme", - "dependencies": { - "rc": "^1.2.8" - }, - "devDependencies": { - "istanbul": "^0.4.2", - "mocha": "^6.1.4", - "require-uncached": "^1.0.2", - "standard": "^12.0.1" + "scripts": { + "coverage": "istanbul cover _mocha", + "posttest": "standard", + "test": "mocha" }, "standard": { "ignore": [ "coverage/**" ] - } - -,"_resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.1.1.tgz" -,"_integrity": "sha512-9bKS7nTl9+/A1s7tnPeGrUpRcVY+LUh7bfFgzpndALdPfXQBfQV77rQVtqgUV3ti4vc/Ik81Ex8UJDWDQ12zQA==" -,"_from": "registry-auth-token@4.1.1" -} \ No newline at end of file + }, + "version": "4.2.1" +} diff --git a/node_modules/registry-auth-token/test/auth-token.test.js b/node_modules/registry-auth-token/test/auth-token.test.js deleted file mode 100644 index fbebeea..0000000 --- a/node_modules/registry-auth-token/test/auth-token.test.js +++ /dev/null @@ -1,474 +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.deepStrictEqual(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.deepStrictEqual(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.deepStrictEqual(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.deepStrictEqual(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.deepStrictEqual(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.deepStrictEqual(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.deepStrictEqual(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.deepStrictEqual(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.deepStrictEqual(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.deepStrictEqual(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.deepStrictEqual(getAuthToken('https://registry.blah.edu/foo/bar/baz', opts), { token: 'recurseNoLevel', type: 'Bearer' }) - assert.deepStrictEqual(getAuthToken('https://registry.blah.org/foo/bar/baz', opts), { token: 'recurseExactlyOneLevel', type: 'Bearer' }) - assert.deepStrictEqual(getAuthToken('https://registry.blah.com/foo/bar/baz', opts), { token: 'whatev', type: 'Bearer' }) - assert.deepStrictEqual(getAuthToken('http://registry.blah.eu/what/ever', opts), { token: 'yep', type: 'Bearer' }) - assert.deepStrictEqual(getAuthToken('http://registry.blah.eu//what/ever', opts), undefined, 'does not hang') - assert.strictEqual(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.deepStrictEqual(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.deepStrictEqual(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.deepStrictEqual( - 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.strictEqual(getAuthToken('//registry.foobar.eu'), undef) - assert.strictEqual(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.deepStrictEqual(token, { - token: 'Zm9vYmFyOmZvb2Jhcg==', - type: 'Basic', - username: 'foobar', - password: 'foobar' - }) - assert.strictEqual(decodeBase64(token.token), 'foobar:foobar') - done() - }) - }) - - it('should return basic token if _auth is base64 encoded', function (done) { - var content = [ - 'registry=http://registry.foobar.eu/', - '//registry.foobar.eu/:_auth=' + encodeBase64('foobar:foobar') - ].join('\n') - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - var token = getAuthToken() - assert.deepStrictEqual(token, { - token: 'Zm9vYmFyOmZvb2Jhcg==', - type: 'Basic' - }) - assert.strictEqual(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.deepStrictEqual(token, { - token: 'Zm9vYmFyOmZvb2Jhcg==', - type: 'Basic', - username: 'foobar', - password: 'foobar' - }) - assert.strictEqual(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.deepStrictEqual(token, { - type: 'Basic', - username: 'username', - password: 'password', - token: 'dXNlcm5hbWU6cGFzc3dvcmQ=' - }) - assert.strictEqual(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.deepStrictEqual(token, { - type: 'Basic', - username: 'username', - password: 'password', - token: 'dXNlcm5hbWU6cGFzc3dvcmQ=' - }) - assert.strictEqual(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.deepStrictEqual(token, { - token: 'YmFyYmF6OmJhcmJheQ==', - type: 'Basic', - password: 'barbay', - username: 'barbaz' - }) - assert.strictEqual(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.deepStrictEqual(token, { - token: 'YmFyYmF6OmJhcmJheQ==', - type: 'Basic', - password: 'barbay', - username: 'barbaz' - }) - assert.strictEqual(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.deepStrictEqual(token, { - token: 'YmFyYmF6OmJhcmJheQ==', - type: 'Basic', - password: 'barbay', - username: 'barbaz' - }) - assert.strictEqual(decodeBase64(token.token), 'barbaz:barbay') - token = getAuthToken('https://registry.blah.eu/foo/bar/baz', opts) - assert.deepStrictEqual(token, { - token: 'YmFyYmF6OmZvb2Jheg==', - type: 'Basic', - password: 'foobaz', - username: 'barbaz' - }) - assert.strictEqual(decodeBase64(token.token), 'barbaz:foobaz') - assert.strictEqual(getAuthToken('//some.registry', opts), undef) - done() - }) - }) - }) -}) diff --git a/node_modules/registry-auth-token/test/registry-url.test.js b/node_modules/registry-auth-token/test/registry-url.test.js deleted file mode 100644 index 78e6ca0..0000000 --- a/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.strictEqual(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.strictEqual(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.strictEqual(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.strictEqual(getRegistryUrl(), 'http://registry.foobar.eu/') - done() - }) - }) -}) diff --git a/node_modules/term-size/license b/node_modules/term-size/license index e7af2f7..fa7ceba 100644 --- a/node_modules/term-size/license +++ b/node_modules/term-size/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +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: diff --git a/node_modules/term-size/package.json b/node_modules/term-size/package.json index d0980de..dfd4fe2 100644 --- a/node_modules/term-size/package.json +++ b/node_modules/term-size/package.json @@ -1,47 +1,75 @@ { - "name": "term-size", - "version": "2.2.0", - "description": "Reliably get the terminal window size (columns & rows)", - "license": "MIT", - "repository": "sindresorhus/term-size", - "funding": "https://github.com/sponsors/sindresorhus", - "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", - "vendor" - ], - "keywords": [ - "terminal", - "size", - "console", - "window", - "width", - "height", - "columns", - "rows", - "lines", - "tty", - "redirected" - ], - "devDependencies": { - "ava": "^2.4.0", - "execa": "^3.4.0", - "tsd": "^0.11.0", - "xo": "^0.25.3" - } - -,"_resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.0.tgz" -,"_integrity": "sha512-a6sumDlzyHVJWb8+YofY4TW112G6p2FCPEAFk+59gIYHv3XHRhm9ltVQ9kli4hNWeQBwSpe8cRN25x0ROunMOw==" -,"_from": "term-size@2.2.0" -} \ No newline at end of file + "_from": "term-size@^2.1.0", + "_id": "term-size@2.2.1", + "_inBundle": false, + "_integrity": "sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==", + "_location": "/term-size", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "term-size@^2.1.0", + "name": "term-size", + "escapedName": "term-size", + "rawSpec": "^2.1.0", + "saveSpec": null, + "fetchSpec": "^2.1.0" + }, + "_requiredBy": [ + "/boxen" + ], + "_resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", + "_shasum": "2a6a54840432c2fb6320fea0f415531e90189f54", + "_spec": "term-size@^2.1.0", + "_where": "C:\\Users\\Jonasz\\Desktop\\Menui\\menui_backend\\node_modules\\boxen", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/term-size/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Reliably get the terminal window size (columns & rows)", + "devDependencies": { + "ava": "^2.4.0", + "execa": "^3.4.0", + "tsd": "^0.11.0", + "xo": "^0.25.3" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts", + "vendor" + ], + "funding": "https://github.com/sponsors/sindresorhus", + "homepage": "https://github.com/sindresorhus/term-size#readme", + "keywords": [ + "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 && tsd" + }, + "version": "2.2.1" +} diff --git a/node_modules/term-size/readme.md b/node_modules/term-size/readme.md index b69715d..db2c566 100644 --- a/node_modules/term-size/readme.md +++ b/node_modules/term-size/readme.md @@ -1,4 +1,4 @@ -# term-size [![Build Status](https://travis-ci.org/sindresorhus/term-size.svg?branch=master)](https://travis-ci.org/sindresorhus/term-size) +# term-size [![Build Status](https://travis-ci.com/sindresorhus/term-size.svg?branch=master)](https://travis-ci.com/github/sindresorhus/term-size) > Reliably get the terminal window size diff --git a/node_modules/term-size/vendor/.DS_Store b/node_modules/term-size/vendor/.DS_Store index 0e3ecd4375b6285a5a35ee700a18411433c777a5..658c571e58b97feced7a765acab347728c06c659 100644 GIT binary patch delta 1157 zcmb`GOKeP07{|ZAqW9dBX-_*dT90b!BQ32yQB=)L#UmcAv`wGEwD;nsGk54r>k&F> zNJLafCQ5=>NJOv@B@tp%7Iui)G&W+|J?|;tu&j0`W?g`%s z-<<~{Wkq#u;*l8U>gIN%H)1v$NA$#`JCLaKxDzkk-gv&Rg6xMWw_J1P=M|JJtFB!e zNT#KW4ArfA+XjuO(G${J4;or*Uq>+7tDBl(?(H-*-HaJ~485OaqztnbGZ@yB8R;S| zE1UE7fga<)fDt<^@)gB7D~IPYabM}yf-!wtM6-5k$+Wm^!*jS?)ny3{{knY1y4Agi z7c&u5TB7pKPGzZD#zd60^ckkJhF7RniqKeVDA=Qi>_vRJx>6BaSlgi9A2lMTQ(Udq zDH$kb?Y)t3SYABpl-I?%UlGrgomTU$!Dy^;zi!I@mXC%U&O5BSU(<9=QSyDoPExj2 zCO`_!rNvZ3o2ZF8NTY)^Lg#6eF3>f)P50;_J*DULf?iRQCg?4_qxbZIKGGNZO5f-^ z7&4pSh6i~l!4j0B3{_ZzI@Dtw)?*vCqX|3EhTRCF7aBqsz#tCe2##X}XK)tha1}Rj z7h|}G#~8zIA zrZWFE3nJBuQb}fI&z+aIh;v~@=zJCyaaBNaX12PdNUAe_YRk%{mLiEdT6K-e#ViTW z*;%_vRmDsZjWb7HTQB9=5~L#s8l+6tq_HU={(|8qjnTM7@S5Jxq>TR)eF2aP7qXCx zMJPZaicpS9RHFvVW$r%s18A_rZ?wbjL^pO~mqcKo4`G;y;E)7x6vr@xlQ@ObHi}VP p#3fwD6}9EOE1YTA|6lIoatfzo|DWCCmi?EEee<#zKLF_c2o3-M delta 1149 zcmb`GO-NKx7>2)BEzi9N^^A@>nr5b%e~gM+{$x(3CS+MUqLx&n_X?ME#%4xK3kSn? zWj`a;q82HwED$6KT-2h4n;^rD6}4&6qD|1MAUboew38^jiwoy_?>XQ1KJU3xt|`~T za}ixxRTf?rlTj^dxWt|uewWnX>Nfg)-VS42KP$vYKyTLvJwansZ}bH9fPlj0<5G6) z$}Mn~SJgGF#U}_`Vv?$!GBn*AGzJXaAAVtXgxp@wkZy~fRFpMaf{5o1p3X!L>mKPd zE{qt#F>_-^CRckkdG0Zv7TKzaXG}4b>`cy2N0h^UUA{HO%<`T*uDSzqG~wC!u&_u~ z-RBLjCIYfmWSWvvm3M{)J$?G1&=hN5MWxESMs zL=h@bjanQ)9h%XK<7mSP^uU9DXwc!sMU3MzuHYJG?6`}2xQ|De#T=eu3CnmDo=9qo zX=*<5C+hOQMZF$pA&7cnNHEXB!76`7-mwzP7!lF7itHcPEiYZRHOh_Tci>8r&4Ln3ELG?8Z@6IsZY*o#mMC-$QX zH4=Rznk4!boJ2d^=tNgB&Ta4?fDgm)BY+W1AcRR=#T0H}8n { - console.error('\n' + boxen()(message, {align: 'center'})); + console.error(boxen()(message, {align: 'center'})); }); } } @@ -151,7 +151,7 @@ class UpdateNotifier { borderStyle: 'round' }; - const message = '\n' + boxen()( + const message = boxen()( pupa()(template, { packageName: this.packageName, currentVersion: this.update.current, diff --git a/node_modules/update-notifier/package.json b/node_modules/update-notifier/package.json index 5aa45bd..cc530b8 100644 --- a/node_modules/update-notifier/package.json +++ b/node_modules/update-notifier/package.json @@ -1,68 +1,96 @@ { - "name": "update-notifier", - "version": "4.1.0", - "description": "Update notifications for your CLI app", - "license": "BSD-2-Clause", - "repository": "yeoman/update-notifier", - "funding": "https://github.com/yeoman/update-notifier?sponsor=1", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava --timeout=20s -s" - }, - "files": [ - "index.js", - "check.js" - ], - "keywords": [ - "npm", - "update", - "updater", - "notify", - "notifier", - "check", - "checker", - "cli", - "module", - "package", - "version" - ], - "dependencies": { - "boxen": "^4.2.0", - "chalk": "^3.0.0", - "configstore": "^5.0.1", - "has-yarn": "^2.1.0", - "import-lazy": "^2.1.0", - "is-ci": "^2.0.0", - "is-installed-globally": "^0.3.1", - "is-npm": "^4.0.0", - "is-yarn-global": "^0.3.0", - "latest-version": "^5.0.0", - "pupa": "^2.0.1", - "semver-diff": "^3.1.1", - "xdg-basedir": "^4.0.0" - }, - "devDependencies": { - "ava": "^2.4.0", - "clear-module": "^4.0.0", - "fixture-stdout": "^0.2.1", - "mock-require": "^3.0.3", - "strip-ansi": "^6.0.0", - "xo": "^0.26.1" - }, - "xo": { - "rules": { - "prefer-object-spread": 0 - } - } - -,"_resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.0.tgz" -,"_integrity": "sha512-w3doE1qtI0/ZmgeoDoARmI5fjDoT93IfKgEGqm26dGUOh8oNpaSTsGNdYRN/SjOuo10jcJGwkEL3mroKzktkew==" -,"_from": "update-notifier@4.1.0" -} \ No newline at end of file + "_from": "update-notifier@^4.1.0", + "_id": "update-notifier@4.1.3", + "_inBundle": false, + "_integrity": "sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A==", + "_location": "/update-notifier", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "update-notifier@^4.1.0", + "name": "update-notifier", + "escapedName": "update-notifier", + "rawSpec": "^4.1.0", + "saveSpec": null, + "fetchSpec": "^4.1.0" + }, + "_requiredBy": [ + "/nodemon" + ], + "_resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.3.tgz", + "_shasum": "be86ee13e8ce48fb50043ff72057b5bd598e1ea3", + "_spec": "update-notifier@^4.1.0", + "_where": "C:\\Users\\Jonasz\\Desktop\\Menui\\menui_backend\\node_modules\\nodemon", + "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": "^4.2.0", + "chalk": "^3.0.0", + "configstore": "^5.0.1", + "has-yarn": "^2.1.0", + "import-lazy": "^2.1.0", + "is-ci": "^2.0.0", + "is-installed-globally": "^0.3.1", + "is-npm": "^4.0.0", + "is-yarn-global": "^0.3.0", + "latest-version": "^5.0.0", + "pupa": "^2.0.1", + "semver-diff": "^3.1.1", + "xdg-basedir": "^4.0.0" + }, + "deprecated": false, + "description": "Update notifications for your CLI app", + "devDependencies": { + "ava": "^2.4.0", + "clear-module": "^4.0.0", + "fixture-stdout": "^0.2.1", + "mock-require": "^3.0.3", + "strip-ansi": "^6.0.0", + "xo": "^0.25.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "check.js" + ], + "funding": "https://github.com/yeoman/update-notifier?sponsor=1", + "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 -s" + }, + "version": "4.1.3", + "xo": { + "rules": { + "prefer-object-spread": 0 + } + } +} diff --git a/node_modules/update-notifier/readme.md b/node_modules/update-notifier/readme.md index 30d1173..afab894 100644 --- a/node_modules/update-notifier/readme.md +++ b/node_modules/update-notifier/readme.md @@ -203,11 +203,10 @@ The idea for this module came from the desire to apply the browser update strate 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 +- [Yeoman](https://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 +- [Node GH](https://github.com/node-gh/gh) - GitHub command line tool [And 2700+ more…](https://www.npmjs.org/browse/depended/update-notifier) diff --git a/package-lock.json b/package-lock.json index 34fb3d4..b52eb81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2096,9 +2096,9 @@ "dev": true }, "axios": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.20.0.tgz", - "integrity": "sha512-ANA4rr2BDcmmAQLOKft2fufrtuvlqR+cXNNinUmvfeSNCOF98PZL+7M/v1zIdGo7OLjEA9J2gXJL+j4zGsl0bA==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", "requires": { "follow-redirects": "^1.10.0" } @@ -2326,9 +2326,9 @@ "integrity": "sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms=" }, "binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" }, "bl": { "version": "2.2.1", @@ -2519,9 +2519,9 @@ }, "dependencies": { "get-stream": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", - "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "requires": { "pump": "^3.0.0" } @@ -2585,9 +2585,9 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "requires": { "has-flag": "^4.0.0" } @@ -2601,18 +2601,26 @@ "dev": true }, "chokidar": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.0.tgz", - "integrity": "sha512-aXAaho2VJtisB/1fg1+3nlLJqGOuewTzQpd/Tz0yTg2R0e4IGtshYvtjowyEumcBv2z+y4+kc75Mz7j5xJskcQ==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", + "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", "requires": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.1.2", + "fsevents": "~2.3.1", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.4.0" + "readdirp": "~3.5.0" + }, + "dependencies": { + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "optional": true + } } }, "ci-info": { @@ -2644,9 +2652,9 @@ } }, "cli-boxes": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.0.tgz", - "integrity": "sha512-gpaBrMAizVEANOpfZp/EEUixTXDyGt7DFzdK5hU+UbWt/J0lB0w20ncZj59Z9a93xHb9u12zF5BS6i9RKbtg4w==" + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==" }, "cliui": { "version": "6.0.0", @@ -2856,6 +2864,11 @@ "which": "^1.2.9" } }, + "crypto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz", + "integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==" + }, "crypto-random-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", @@ -3102,9 +3115,9 @@ "integrity": "sha512-ZjI4zqTaxveH2/tTlzS1wFp+7ncxNZaIEWYg3lzZRHkKf5zPT/MnEG6WL0BhHMJUabkh8GeU5NL5j+rEUCb7Ug==" }, "dot-prop": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.2.0.tgz", - "integrity": "sha512-uEUyaDKoSQ1M4Oq8l45hSE26SnTxL6snNnqvK/VWx5wJhmff5z0FUVJDKDanor/6w3kzE3i7XZOk+7wC0EXr1A==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", "requires": { "is-obj": "^2.0.0" } @@ -3542,9 +3555,9 @@ } }, "follow-redirects": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", - "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==" + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.2.tgz", + "integrity": "sha512-6mPTgLxYm3r6Bkkg0vNM0HTjfGrOEtsfbhagQvbxDEsEkpNhw582upBaoRZylzen6krEmxXJgt9Ju6HiI4O7BA==" }, "for-in": { "version": "1.0.2", @@ -3606,6 +3619,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, "optional": true }, "function-bind": { @@ -3683,11 +3697,11 @@ } }, "global-dirs": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.0.1.tgz", - "integrity": "sha512-5HqUqdhkEovj2Of/ms3IeS/EekcO54ytHRLV4PEY2rhRwrHXLQjeVEES0Lhka0xwNDtGYn58wyC4s5+MHsOO6A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.1.0.tgz", + "integrity": "sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ==", "requires": { - "ini": "^1.3.5" + "ini": "1.3.7" } }, "globals": { @@ -3990,9 +4004,9 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", + "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==" }, "into-stream": { "version": "6.0.0", @@ -5922,9 +5936,9 @@ "integrity": "sha512-BVZBDi+aJV4O38rxsUh164Dk1NCqgh6Cm0rQSb9SK/DHGll/DrCMnycVDD7msJgZCnmVa8ASo8EZzR7jsgTukQ==" }, "nodemon": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.4.tgz", - "integrity": "sha512-Ltced+hIfTmaS28Zjv1BM552oQ3dbwPqI4+zI0SLgq+wpJhSyqgYude/aZa/3i31VCQWMfXJVxvu86abcam3uQ==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.7.tgz", + "integrity": "sha512-XHzK69Awgnec9UzHr1kc8EomQh4sjTQ8oRf8TsGrSmHDx9/UmiGG9E/mM3BuTfNeFwdNBvrqQq/RHL0xIeyFOA==", "requires": { "chokidar": "^3.2.2", "debug": "^3.2.6", @@ -5934,22 +5948,22 @@ "semver": "^5.7.1", "supports-color": "^5.5.0", "touch": "^3.1.0", - "undefsafe": "^2.0.2", - "update-notifier": "^4.0.0" + "undefsafe": "^2.0.3", + "update-notifier": "^4.1.0" }, "dependencies": { "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "requires": { "ms": "^2.1.1" } }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" } } }, @@ -6357,9 +6371,9 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, "pupa": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.0.1.tgz", - "integrity": "sha512-hEJH0s8PXLY/cdXh66tNEQGndDrIKNqNC5xmrysZy3i5C3oEoLna7YAOad+7u125+zH1HNXUmGEkrhb3c2VriA==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", + "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", "requires": { "escape-goat": "^2.0.0" } @@ -6453,9 +6467,9 @@ } }, "readdirp": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", - "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", + "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", "requires": { "picomatch": "^2.2.1" } @@ -6525,9 +6539,9 @@ } }, "registry-auth-token": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.1.1.tgz", - "integrity": "sha512-9bKS7nTl9+/A1s7tnPeGrUpRcVY+LUh7bfFgzpndALdPfXQBfQV77rQVtqgUV3ti4vc/Ik81Ex8UJDWDQ12zQA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", + "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", "requires": { "rc": "^1.2.8" } @@ -7506,9 +7520,9 @@ "dev": true }, "term-size": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.0.tgz", - "integrity": "sha512-a6sumDlzyHVJWb8+YofY4TW112G6p2FCPEAFk+59gIYHv3XHRhm9ltVQ9kli4hNWeQBwSpe8cRN25x0ROunMOw==" + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", + "integrity": "sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==" }, "terminal-link": { "version": "2.1.1", @@ -7800,9 +7814,9 @@ } }, "update-notifier": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.0.tgz", - "integrity": "sha512-w3doE1qtI0/ZmgeoDoARmI5fjDoT93IfKgEGqm26dGUOh8oNpaSTsGNdYRN/SjOuo10jcJGwkEL3mroKzktkew==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.3.tgz", + "integrity": "sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A==", "requires": { "boxen": "^4.2.0", "chalk": "^3.0.0", diff --git a/package.json b/package.json index c37dbac..fc9d43e 100644 --- a/package.json +++ b/package.json @@ -12,11 +12,12 @@ "dependencies": { "@azure/storage-blob": "^12.2.0-preview.1", "aws-sdk": "^2.789.0", - "axios": "^0.20.0", + "axios": "^0.21.1", "bcryptjs": "^2.4.3", "body-parser": "^1.19.0", "cookie": "^0.4.1", "cors": "^2.8.5", + "crypto": "^1.0.1", "dotenv": "^8.2.0", "esm": "^3.2.25", "express": "^4.17.1", @@ -29,7 +30,7 @@ "multer": "^1.4.2", "multer-s3": "^2.9.0", "nodemailer": "^6.4.11", - "nodemon": "^2.0.4", + "nodemon": "^2.0.7", "string-sanitizer": "^1.1.1", "validator": "^13.1.1" }, diff --git a/routes/routeAdmin.js b/routes/routeAdmin.js new file mode 100644 index 0000000..482cd45 --- /dev/null +++ b/routes/routeAdmin.js @@ -0,0 +1,26 @@ +const express = require("express"); +const { appkey } = require("../config") +const { fetchAllAdminData } = require("../services/databaseServices.js"); +const { + newError, + handleError, + encryptRSA + } = require("../services/services.js"); + +var router = express.Router(); + +router.post("/getall", async (req, res) => { + try { + if(req.body.key === appkey){ + const results = await fetchAllAdminData(); + const encrypted = encryptRSA(results) + res.send(encrypted) + } else { + throw newError("Brak dostępu", 403) + } + } catch (error) { + handleError(error, res) + } +}) + +module.exports = router; \ No newline at end of file diff --git a/services/databaseServices.js b/services/databaseServices.js index dc6b02d..fd1fc9a 100644 --- a/services/databaseServices.js +++ b/services/databaseServices.js @@ -2,6 +2,7 @@ const Restaurant = require("../models/restaurant.js"); const Dish = require("../models/dish.js"); const User = require("../models/users.js"); const Payments = require("../models/payments.js"); +const Report = require("../models/reports.js") const { deleteImage } = require("./oceanServices.js"); const { newError } = require("./services.js"); const mongoose = require("mongoose"); @@ -398,6 +399,18 @@ async function setRestaurantVisibility(restaurantId, visible) { ); } +async function fetchAllAdminData(){ + const restaurants = await Restaurant.find({}, "_id name city adress subscriptionActive subscriptionDue phone dishes"); + const reports = await Report.find({}); + const users = await User.find({}, "_id email firstname lastname login billing isRestaurant restaurants trialUsed photos"); + const result = { + restaurants: restaurants, + reports: reports, + users: users + } + return result; +} + exports.changeUserPass = changeUserPass; exports.removeDish = removeDish; exports.removeRestaurant = removeRestaurant; @@ -416,3 +429,4 @@ exports.fetchUser = fetchUser; exports.initializePayment = initializePayment; exports.setRestaurantVisibility = setRestaurantVisibility; exports.startTrial = startTrial; +exports.fetchAllAdminData = fetchAllAdminData; diff --git a/services/services.js b/services/services.js index 54d5ec3..4f0f58c 100644 --- a/services/services.js +++ b/services/services.js @@ -6,7 +6,8 @@ const sanitizer = require("string-sanitizer"); const { renameBlob } = require("./oceanServices.js"); const jwt = require("jsonwebtoken"); const bcrypt = require("bcryptjs"); -const { jwtSecret } = require("../config/index.js"); +const crypto = require("crypto") +const { jwtSecret, publicKey } = require("../config/index.js"); function newError(message, status) { const error = { @@ -25,6 +26,17 @@ function handleError(error, responseObject) { } } +function encryptRSA(data) { + const encrypted = crypto.publicEncrypt({ + key: publicKey, + padding: crypto.constants.RSA_PKCS1_OAEP_PADDING, + oaepHash: "sha256" + }, + Buffer.from(JSON.stringify(data)) + ) + return encrypted; +} + async function validateRestaurant(id) { if (!mongoose.Types.ObjectId.isValid(id)) throw newError("Nieprawidłowy ID", 204); @@ -193,3 +205,4 @@ exports.hashPass = hashPass; exports.saveImage = saveImage; exports.generateRefreshToken = generateRefreshToken; exports.validateRefreshToken = validateRefreshToken; +exports.encryptRSA = encryptRSA