Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove localtunnel #2059

Merged
merged 7 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"packages": [
"packages/*"
],
"version": "2.29.3"
"version": "3.0.0"
}
4 changes: 2 additions & 2 deletions packages/browser-sync-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/browser-sync-client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "browser-sync-client",
"description": "Client-side scripts for BrowserSync",
"version": "2.29.3",
"version": "3.0.0",
"homepage": "https://github.com/shakyshane/browser-sync-client",
"author": "Shane Osbourne <[email protected]>",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/browser-sync-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/browser-sync-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "browser-sync-ui",
"description": "User Interface for BrowserSync",
"version": "2.29.3",
"version": "3.0.0",
"homepage": "http://www.browsersync.io/",
"author": {
"name": "Shane Osbourne"
Expand Down
3 changes: 3 additions & 0 deletions packages/browser-sync/lib/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
13 changes: 12 additions & 1 deletion packages/browser-sync/lib/tunnel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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);
}
Expand Down
Loading
Loading