From b7bf92e3bd8b4324061a4fec439b58b308f19263 Mon Sep 17 00:00:00 2001 From: Shane Osbourne Date: Wed, 27 Dec 2023 19:50:42 +0000 Subject: [PATCH] remove package --- packages/browser-sync/lib/async.js | 3 + packages/browser-sync/lib/tunnel.js | 13 +- packages/browser-sync/package-lock.json | 209 ++---------------------- packages/browser-sync/package.json | 8 - 4 files changed, 29 insertions(+), 204 deletions(-) diff --git a/packages/browser-sync/lib/async.js b/packages/browser-sync/lib/async.js index ebf2c0afb..699a1cfe9 100644 --- a/packages/browser-sync/lib/async.js +++ b/packages/browser-sync/lib/async.js @@ -225,6 +225,9 @@ module.exports = { var localTunnel = require("./tunnel"); localTunnel(bs, function(err, tunnel) { if (err) { + if (err.code === "MODULE_NOT_FOUND") { + return utils.fail(true, err, bs.cb); + } return done(err); } else { return done(null, { diff --git a/packages/browser-sync/lib/tunnel.js b/packages/browser-sync/lib/tunnel.js index 2dda0400d..2192066cd 100644 --- a/packages/browser-sync/lib/tunnel.js +++ b/packages/browser-sync/lib/tunnel.js @@ -8,6 +8,17 @@ var utils = require("util"); * @param {Function} cb */ module.exports = function(bs, cb) { + var localtunnel; + try { + localtunnel = require("localtunnel"); + } catch (e) { + if (e.code === "MODULE_NOT_FOUND") { + var error = new Error("Could not find package `localtunnel`. From Browsersync version 3.0 you'll need to install this manually."); + error.code = e.code; + return cb(error); + } + return cb(e); + } var opts = {}; var options = bs.options; var port = options.get("port"); @@ -22,7 +33,7 @@ module.exports = function(bs, cb) { utils.inspect(opts) ); - require("localtunnel")(port, opts, function(err, tunnel) { + localtunnel(port, opts, function(err, tunnel) { if (err) { return cb(err); } diff --git a/packages/browser-sync/package-lock.json b/packages/browser-sync/package-lock.json index fc0d47b6e..c80eed51c 100644 --- a/packages/browser-sync/package-lock.json +++ b/packages/browser-sync/package-lock.json @@ -64,14 +64,6 @@ }, "engines": { "node": ">= 8.0.0" - }, - "optionalDependencies": { - "localtunnel": "^2.0.2" - }, - "peerDependenciesMeta": { - "localtunnel": { - "optional": true - } } }, "node_modules/@socket.io/component-emitter": { @@ -250,15 +242,6 @@ "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", "dev": true }, - "node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "optional": true, - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, "node_modules/backo2": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", @@ -349,9 +332,9 @@ "dev": true }, "node_modules/browser-sync-client": { - "version": "3.0.0-alpha.0", - "resolved": "https://registry.npmjs.org/browser-sync-client/-/browser-sync-client-3.0.0-alpha.0.tgz", - "integrity": "sha512-6Wu1QHScJf+8ttMDXXIVV6f1O5EmJZ7e3SUoc4QG5PfbBgwg8JxHFhbw/j69VBAdns0jBNXQXvRD7Gy19BOAGg==", + "version": "3.0.0-alpha.1", + "resolved": "https://registry.npmjs.org/browser-sync-client/-/browser-sync-client-3.0.0-alpha.1.tgz", + "integrity": "sha512-k6dLFlbnvEK79gmbTHdPe2Ei9KULWwpehcF3Q9AKP2einkofly8ZglZBMgz8GjEMdeOIVOzEd3Q5lIZVh+Cu0w==", "dependencies": { "etag": "1.8.1", "fresh": "0.5.2", @@ -362,9 +345,9 @@ } }, "node_modules/browser-sync-ui": { - "version": "3.0.0-alpha.0", - "resolved": "https://registry.npmjs.org/browser-sync-ui/-/browser-sync-ui-3.0.0-alpha.0.tgz", - "integrity": "sha512-6MfhChHoohX5cgyC9HtfVLl/IUb5qWRODRKdXbma5dfyO7HQ91TnqIHJ3uWEdVVD2mYYhiNjBmeqg9EVPOLB0Q==", + "version": "3.0.0-alpha.1", + "resolved": "https://registry.npmjs.org/browser-sync-ui/-/browser-sync-ui-3.0.0-alpha.1.tgz", + "integrity": "sha512-AmGlpOYaMLRJ28cELXlzvGrbt1tPNChYxfd+dP57eIsj8kP9QbeFqSc9raRDHDA5Hq6W2hHpCZT5CL5hWkVeQA==", "dependencies": { "async-each-series": "0.1.1", "chalk": "4.1.2", @@ -1590,88 +1573,6 @@ "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz", "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==" }, - "node_modules/localtunnel": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/localtunnel/-/localtunnel-2.0.2.tgz", - "integrity": "sha512-n418Cn5ynvJd7m/N1d9WVJISLJF/ellZnfsLnx8WBWGzxv/ntNcFkJ1o6se5quUhCplfLGBNL5tYHiq5WF3Nug==", - "optional": true, - "dependencies": { - "axios": "0.21.4", - "debug": "4.3.2", - "openurl": "1.1.1", - "yargs": "17.1.1" - }, - "bin": { - "lt": "bin/lt.js" - }, - "engines": { - "node": ">=8.3.0" - } - }, - "node_modules/localtunnel/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "optional": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/localtunnel/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/localtunnel/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "optional": true - }, - "node_modules/localtunnel/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "optional": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/localtunnel/node_modules/yargs": { - "version": "17.1.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.1.1.tgz", - "integrity": "sha512-c2k48R0PwKIqKhPMWjeiF6y2xY/gPMUlro0sgxqXpbOIohWiLNXWslsootttv7E1e73QPAMQSg5FeySbVcpsPQ==", - "optional": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -2057,12 +1958,6 @@ "wrappy": "1" } }, - "node_modules/openurl": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/openurl/-/openurl-1.1.1.tgz", - "integrity": "sha1-OHW0sO96UsFW8NtB1GCduw+Us4c=", - "optional": true - }, "node_modules/opn": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/opn/-/opn-5.3.0.tgz", @@ -3168,7 +3063,7 @@ "version": "20.2.4", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "devOptional": true, + "dev": true, "engines": { "node": ">=10" } @@ -3391,15 +3286,6 @@ "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", "dev": true }, - "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "optional": true, - "requires": { - "follow-redirects": "^1.14.0" - } - }, "backo2": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", @@ -3478,9 +3364,9 @@ "dev": true }, "browser-sync-client": { - "version": "3.0.0-alpha.0", - "resolved": "https://registry.npmjs.org/browser-sync-client/-/browser-sync-client-3.0.0-alpha.0.tgz", - "integrity": "sha512-6Wu1QHScJf+8ttMDXXIVV6f1O5EmJZ7e3SUoc4QG5PfbBgwg8JxHFhbw/j69VBAdns0jBNXQXvRD7Gy19BOAGg==", + "version": "3.0.0-alpha.1", + "resolved": "https://registry.npmjs.org/browser-sync-client/-/browser-sync-client-3.0.0-alpha.1.tgz", + "integrity": "sha512-k6dLFlbnvEK79gmbTHdPe2Ei9KULWwpehcF3Q9AKP2einkofly8ZglZBMgz8GjEMdeOIVOzEd3Q5lIZVh+Cu0w==", "requires": { "etag": "1.8.1", "fresh": "0.5.2", @@ -3488,9 +3374,9 @@ } }, "browser-sync-ui": { - "version": "3.0.0-alpha.0", - "resolved": "https://registry.npmjs.org/browser-sync-ui/-/browser-sync-ui-3.0.0-alpha.0.tgz", - "integrity": "sha512-6MfhChHoohX5cgyC9HtfVLl/IUb5qWRODRKdXbma5dfyO7HQ91TnqIHJ3uWEdVVD2mYYhiNjBmeqg9EVPOLB0Q==", + "version": "3.0.0-alpha.1", + "resolved": "https://registry.npmjs.org/browser-sync-ui/-/browser-sync-ui-3.0.0-alpha.1.tgz", + "integrity": "sha512-AmGlpOYaMLRJ28cELXlzvGrbt1tPNChYxfd+dP57eIsj8kP9QbeFqSc9raRDHDA5Hq6W2hHpCZT5CL5hWkVeQA==", "requires": { "async-each-series": "0.1.1", "chalk": "4.1.2", @@ -4440,67 +4326,6 @@ "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz", "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==" }, - "localtunnel": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/localtunnel/-/localtunnel-2.0.2.tgz", - "integrity": "sha512-n418Cn5ynvJd7m/N1d9WVJISLJF/ellZnfsLnx8WBWGzxv/ntNcFkJ1o6se5quUhCplfLGBNL5tYHiq5WF3Nug==", - "optional": true, - "requires": { - "axios": "0.21.4", - "debug": "4.3.2", - "openurl": "1.1.1", - "yargs": "17.1.1" - }, - "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "optional": true, - "requires": { - "ms": "2.1.2" - } - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "optional": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "optional": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "optional": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "yargs": { - "version": "17.1.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.1.1.tgz", - "integrity": "sha512-c2k48R0PwKIqKhPMWjeiF6y2xY/gPMUlro0sgxqXpbOIohWiLNXWslsootttv7E1e73QPAMQSg5FeySbVcpsPQ==", - "optional": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - } - } - } - }, "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -4778,12 +4603,6 @@ "wrappy": "1" } }, - "openurl": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/openurl/-/openurl-1.1.1.tgz", - "integrity": "sha1-OHW0sO96UsFW8NtB1GCduw+Us4c=", - "optional": true - }, "opn": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/opn/-/opn-5.3.0.tgz", @@ -5652,7 +5471,7 @@ "version": "20.2.4", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "devOptional": true + "dev": true }, "yargs-unparser": { "version": "2.0.0", diff --git a/packages/browser-sync/package.json b/packages/browser-sync/package.json index 35d727b1f..a1540f7af 100644 --- a/packages/browser-sync/package.json +++ b/packages/browser-sync/package.json @@ -85,14 +85,6 @@ "typescript": "^4.6.2", "vinyl": "1.2.0" }, - "optionalDependencies": { - "localtunnel": "^2.0.2" - }, - "peerDependenciesMeta": { - "localtunnel": { - "optional": true - } - }, "keywords": [ "browser sync", "css",