Skip to content

Commit 6030e87

Browse files
shakyShaneShane Osbourne
and
Shane Osbourne
authored
moving localtunnel to peer dependency (#2059)
* moving localtunnel to peer dependency * v3.0.0-alpha.0 * optiona * v3.0.0-alpha.1 * remove package * v3.0.0-alpha.2 * v3.0.0 --------- Co-authored-by: Shane Osbourne <sosbourne@duckduckgo.com>
1 parent f267cb6 commit 6030e87

File tree

9 files changed

+106
-264
lines changed

9 files changed

+106
-264
lines changed

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"packages": [
33
"packages/*"
44
],
5-
"version": "2.29.3"
5+
"version": "3.0.0"
66
}

packages/browser-sync-client/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/browser-sync-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "browser-sync-client",
33
"description": "Client-side scripts for BrowserSync",
4-
"version": "2.29.3",
4+
"version": "3.0.0",
55
"homepage": "https://github.com/shakyshane/browser-sync-client",
66
"author": "Shane Osbourne <shane.osbourne8@gmail.com>",
77
"repository": {

packages/browser-sync-ui/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/browser-sync-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "browser-sync-ui",
33
"description": "User Interface for BrowserSync",
4-
"version": "2.29.3",
4+
"version": "3.0.0",
55
"homepage": "http://www.browsersync.io/",
66
"author": {
77
"name": "Shane Osbourne"

packages/browser-sync/lib/async.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ module.exports = {
225225
var localTunnel = require("./tunnel");
226226
localTunnel(bs, function(err, tunnel) {
227227
if (err) {
228+
if (err.code === "MODULE_NOT_FOUND") {
229+
return utils.fail(true, err, bs.cb);
230+
}
228231
return done(err);
229232
} else {
230233
return done(null, {

packages/browser-sync/lib/tunnel.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ var utils = require("util");
88
* @param {Function} cb
99
*/
1010
module.exports = function(bs, cb) {
11+
var localtunnel;
12+
try {
13+
localtunnel = require("localtunnel");
14+
} catch (e) {
15+
if (e.code === "MODULE_NOT_FOUND") {
16+
var error = new Error("Could not find package `localtunnel`. From Browsersync version 3.0 you'll need to install this manually.");
17+
error.code = e.code;
18+
return cb(error);
19+
}
20+
return cb(e);
21+
}
1122
var opts = {};
1223
var options = bs.options;
1324
var port = options.get("port");
@@ -22,7 +33,7 @@ module.exports = function(bs, cb) {
2233
utils.inspect(opts)
2334
);
2435

25-
require("localtunnel")(port, opts, function(err, tunnel) {
36+
localtunnel(port, opts, function(err, tunnel) {
2637
if (err) {
2738
return cb(err);
2839
}

0 commit comments

Comments
 (0)