Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

browser-sync

Package Overview
Dependencies
643
Maintainers
1
Versions
299
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.30.0-alpha.3 to 3.0.0-alpha.0

1

dist/args.js

@@ -1,2 +0,1 @@

// @ts-check
"use strict";

@@ -3,0 +2,0 @@ /**

@@ -1,9 +0,4 @@

// @ts-check
var async = require("./async");
module.exports = [
{
step: "Execute any startup runners",
fn: async.execStartupRunners
},
{
step: "Finding an empty port",

@@ -10,0 +5,0 @@ fn: async.getEmptyPort

58

dist/async.js

@@ -1,3 +0,2 @@

// @ts-check
// @ts-expect-error
"use strict";
var _ = require("./lodash.custom");

@@ -9,24 +8,3 @@ var Immutable = require("immutable");

var chalk = require("chalk");
const { toRunnerOption } = require("./types");
const { List } = require("immutable");
const { execRunner } = require("./runner");
const Rx = require("rx");
module.exports = {
execStartupRunners: function (bs, done) {
const runners = bs.options.get("runners", List([])).toJS();
/** @type {import("./types").RunnerOption[]} */
const startupOnlyRunners = runners.filter(r => {
const opt = toRunnerOption(r);
return (opt === null || opt === void 0 ? void 0 : opt.at) === "startup";
});
if (startupOnlyRunners.length === 0)
return done();
Rx.Observable.concat(startupOnlyRunners.map(runner => execRunner(runner)))
.catch(e => {
done(e);
})
.subscribe(() => {
done(null);
});
},
/**

@@ -36,3 +14,3 @@ * BrowserSync needs at least 1 free port.

* and keep incrementing until an available one is found.
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param {Function} done

@@ -102,7 +80,8 @@ */

* as a way of determining network connectivity
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param {Function} done
*/
getOnlineStatus: function (bs, done) {
if (_.isUndefined(bs.options.get("online")) && _.isUndefined(process.env.TESTING)) {
if (_.isUndefined(bs.options.get("online")) &&
_.isUndefined(process.env.TESTING)) {
require("dns").resolve("www.google.com", function (err) {

@@ -130,3 +109,3 @@ var online = false;

* Try to load plugins that were given in options
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param {Function} done

@@ -155,3 +134,3 @@ */

*
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param {Function} done

@@ -172,11 +151,11 @@ */

/**
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param {Function} done
*/
setInternalEvents: function (bs, done) {
require("./internal-events").default(bs);
require("./internal-events")(bs);
done();
},
/**
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param {Function} done

@@ -192,3 +171,3 @@ */

/**
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param {Function} done

@@ -204,3 +183,3 @@ */

/**
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param {Function} done

@@ -218,3 +197,3 @@ */

/**
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param {Function} done

@@ -249,3 +228,3 @@ */

/**
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param {Function} done

@@ -256,3 +235,2 @@ */

// Start the socket, needs an existing server.
// @ts-expect-error
var io = bs.pluginManager.get("socket")(bs.server, clientEvents, bs);

@@ -270,3 +248,3 @@ done(null, {

*
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param {Function} done

@@ -312,7 +290,6 @@ */

/**
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param {Function} done
*/
mergeUiSettings: function (bs, done) {
// @ts-expect-error
if (!bs.ui) {

@@ -323,3 +300,2 @@ return done();

options: {
// @ts-expect-error
urls: bs.options.get("urls").merge(bs.ui.options.get("urls"))

@@ -330,3 +306,3 @@ }

/**
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param {Function} done

@@ -333,0 +309,0 @@ */

@@ -112,3 +112,5 @@ #!/usr/bin/env node

.map(item => item.resolved);
const urls = withoutErrors.filter(item => item.isUrl === true).map(item => item.userInput);
const urls = withoutErrors
.filter(item => item.isUrl === true)
.map(item => item.userInput);
/**

@@ -135,12 +137,5 @@ * If a URL was given, switch to proxy mode and use

function handleCli(opts) {
var _a;
opts.cb = opts.cb || utils.defaultCallback;
const mapping = {
init: () => require("./cli/command.init.js"),
recipe: () => require("./cli/command.recipe.js"),
reload: () => require("./cli/command.reload.js"),
start: () => require("./cli/command.start.js")
};
const m = (_a = mapping[opts.cli.input[0]]) === null || _a === void 0 ? void 0 : _a.call(mapping);
if (m === null || m === void 0 ? void 0 : m.default) {
const m = require(`./cli/command.${opts.cli.input[0]}`);
if (m.default) {
return m.default(opts);

@@ -157,3 +152,4 @@ }

.example("$0 start -p www.bbc.co.uk", "- Proxy an existing website")
.default("cwd", () => process.cwd()).argv;
.default("cwd", () => process.cwd())
.argv;
}

@@ -183,3 +179,4 @@ /**

.example("$0 reload --port 4000")
.default("cwd", () => process.cwd()).argv;
.default("cwd", () => process.cwd())
.argv;
}

@@ -192,3 +189,4 @@ if (command === "recipe") {

.example("$0 recipe gulp.sass", "use the gulp.sass recipe")
.default("cwd", () => process.cwd()).argv;
.default("cwd", () => process.cwd())
.argv;
}

@@ -195,0 +193,0 @@ if (out.help) {

@@ -1,7 +0,5 @@

// @ts-check
// @ts-ignore
"use strict";
var hooks = require("./hooks");
var asyncTasks = require("./async-tasks");
var config = require("./config");
var immutable = require("immutable");
var connectUtils = require("./connect-utils");

@@ -12,3 +10,2 @@ var utils = require("./utils");

var eachSeries = utils.eachSeries;
// @ts-expect-error
var _ = require("./lodash.custom");

@@ -45,4 +42,2 @@ var EE = require("easy-extender");

bs._browserReload = false;
/** @type {import("immutable").Map<string, any>} */
bs.options = immutable.fromJS({});
// Plugin management

@@ -59,3 +54,2 @@ bs.pluginManager = new EE(defaultPlugins, hooks);

if (_.isFunction(cb)) {
// @ts-expect-error
cb.apply(bs.publicInstance, _.toArray(arguments).slice(1));

@@ -65,5 +59,5 @@ }

/**
* @param {import("immutable").Map<string, any>} options
* @param {Map} options
* @param {Function} cb
* @returns {BrowserSync|undefined}
* @returns {BrowserSync}
*/

@@ -91,2 +85,4 @@ BrowserSync.prototype.init = function (options, cb) {

* Save a reference to the original options
* @type {Map}
* @private
*/

@@ -97,3 +93,3 @@ bs._options = options;

* user may of provided
* @type {import("immutable").Map<string, any>}
* @type {Map}
*/

@@ -122,3 +118,3 @@ bs.options = options;

* but they cannot set them directly.
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @returns {Function}

@@ -206,3 +202,3 @@ */

* At this point, ALL async tasks have completed
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @returns {Function}

@@ -212,3 +208,2 @@ */

return function (err) {
var _a;
if (err) {

@@ -247,3 +242,3 @@ bs.logger.setOnce("useLevelPrefixes", true).error(err.message);

*/
(_a = bs.cb) === null || _a === void 0 ? void 0 : _a.call(bs, null, bs);
bs.cb(null, bs);
};

@@ -254,3 +249,3 @@ }

* @param opts
* @param [cb]
* @param cb
*/

@@ -279,7 +274,11 @@ BrowserSync.prototype.registerPlugin = function (module, opts, cb) {

/**
* @param {() => boolean} [filter]
* @param {Function} [filter]
*/
BrowserSync.prototype.getUserPlugins = function (filter) {
var bs = this;
filter = filter || (_ => true);
filter =
filter ||
function () {
return true;
};
/**

@@ -342,3 +341,2 @@ * Transform Plugins option

*/
// @ts-expect-error
bs.app.stack.splice(bs.app.stack.length - 1, 0, entry);

@@ -349,3 +347,2 @@ };

var bs = this;
// @ts-expect-error
if (!bs.app) {

@@ -380,6 +377,6 @@ return;

* @param {String} id
* @returns {Server}
*/
BrowserSync.prototype.removeMiddleware = function (id) {
var bs = this;
// @ts-expect-error
if (!bs.app) {

@@ -438,3 +435,3 @@ return;

/**
* @returns {BrowserSync['options']}
* @returns {BrowserSync.options}
*/

@@ -451,3 +448,3 @@ BrowserSync.prototype.getOptions = function () {

* @param {*} value
* @returns {BrowserSync['options']}
* @returns {BrowserSync.options|*}
*/

@@ -472,3 +469,3 @@ BrowserSync.prototype.setOption = function (name, value, opts) {

* @param opts
* @returns {BrowserSync['options']}
* @returns {Map|*|BrowserSync.options}
*/

@@ -530,7 +527,7 @@ BrowserSync.prototype.setOptionIn = function (path, value, opts) {

* Add a new rewrite rule to the stack
* @param {Object} rule
*/
BrowserSync.prototype.resetMiddlewareStack = function () {
var bs = this;
var middlewares = require("./server/utils").getMiddlewares(bs);
// @ts-expect-error
var middlewares = require("./server/utils").getMiddlewares(bs, bs.options);
bs.app.stack = middlewares;

@@ -558,7 +555,4 @@ };

// Close any core file watchers
// @ts-expect-error
if (bs.watchers) {
// @ts-expect-error
Object.keys(bs.watchers).forEach(function (key) {
// @ts-expect-error
bs.watchers[key].watchers.forEach(function (watcher) {

@@ -565,0 +559,0 @@ watcher.close();

@@ -1,2 +0,1 @@

// @ts-check
"use strict";

@@ -6,3 +5,2 @@ var config = require("../config");

var fs = require("fs");
// @ts-expect-error
var _ = require("../lodash.custom");

@@ -9,0 +7,0 @@ var path = require("path");

@@ -69,2 +69,3 @@ "use strict";

* @param value
* @returns {{globs: Array, objs: Array}}
*/

@@ -71,0 +72,0 @@ function makeFilesArg(value) {

@@ -1,2 +0,1 @@

// @ts-check
"use strict";

@@ -3,0 +2,0 @@ var info = require("./cli-info");

@@ -1,2 +0,1 @@

// @ts-check
"use strict";

@@ -12,2 +11,3 @@ var logger = require("../logger").logger;

* @param opts
* @returns {Function}
*/

@@ -22,3 +22,3 @@ module.exports = function (opts) {

var dirs = fs.readdirSync(path.join(dir, "recipes"));
logger.info("Install one of the following with %s\n", chalk.cyan("browser-sync recipe <name>"));
logger.info("Install one of the following with %s\n", chalk.cyan('browser-sync recipe <name>'));
dirs.forEach(function (name) {

@@ -39,3 +39,5 @@ console.log(" " + name);

var flags = opts.cli.flags;
var output = flags.output ? path.resolve(flags.output) : path.join(process.cwd(), input);
var output = flags.output
? path.resolve(flags.output)
: path.join(process.cwd(), input);
var targetDir = path.join(dir, "recipes", input);

@@ -42,0 +44,0 @@ if (fs.existsSync(output)) {

@@ -1,2 +0,1 @@

// @ts-check
"use strict";

@@ -10,2 +9,3 @@ /**

* @param opts
* @returns {Function}
*/

@@ -12,0 +12,0 @@ module.exports = function (opts) {

@@ -52,3 +52,7 @@ "use strict";

function preprocessFlags(flags) {
return [stripUndefined, legacyFilesArgs, removeWatchBooleanWhenFalse].reduce((flags, fn) => fn.call(null, flags), flags);
return [
stripUndefined,
legacyFilesArgs,
removeWatchBooleanWhenFalse
].reduce((flags, fn) => fn.call(null, flags), flags);
}

@@ -55,0 +59,0 @@ /**

@@ -22,3 +22,2 @@ "use strict";

.toSet();
// @ts-expect-error
const merged = userIgnored.merge(defaultIgnorePatterns);

@@ -25,0 +24,0 @@ return watchOptions.merge({

@@ -37,3 +37,2 @@ "use strict";

.filter(Boolean);
// @ts-expect-error
baseDirs.forEach(s => serverPaths.push(s));

@@ -40,0 +39,0 @@ }

@@ -8,3 +8,6 @@ "use strict";

if (incoming.get("directory")) {
return [incoming.setIn(["server", "directory"], incoming.has("directory")), []];
return [
incoming.setIn(["server", "directory"], incoming.has("directory")),
[]
];
}

@@ -11,0 +14,0 @@ return [incoming, []];

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertRunnerOption = exports.handleFilesOption = void 0;
exports.handleFilesOption = void 0;
const immutable_1 = require("immutable");
const cli_options_1 = require("../cli-options");
const types_1 = require("../../types");
const zod_1 = require("zod");
function handleFilesOption(incoming) {
const value = incoming.get("files");
const namespaces = {

@@ -15,3 +14,3 @@ core: {

};
const processed = (0, cli_options_1.makeFilesArg)(incoming.get("files"));
const processed = (0, cli_options_1.makeFilesArg)(value);
if (processed.globs.length) {

@@ -23,37 +22,5 @@ namespaces.core.globs = processed.globs;

}
const runners = convertRunnerOption(incoming);
return [incoming.set("files", (0, immutable_1.fromJS)(Object.assign(Object.assign({}, namespaces), runners))), []];
return [incoming.set("files", (0, immutable_1.fromJS)(namespaces)), []];
}
exports.handleFilesOption = handleFilesOption;
function convertRunnerOption(incoming) {
const runners = incoming.has("runners");
if (!runners)
return null;
const parser = zod_1.z.array(types_1.runnerOption);
const incomingOpt = incoming.get("runners").toJS();
const runnerData = parser.parse(incomingOpt);
const output = {};
runnerData.forEach((runner, index) => {
if (runner.at !== "runtime")
return;
const next = {
index,
globs: [],
objs: []
};
for (let whenElement of runner.when) {
if ("files" in whenElement) {
whenElement.files.forEach(fileOption => {
next.globs.push(fileOption);
});
output["__unstable_runner_" + index] = next;
}
else {
throw new Error("unreachable - only when.files supported currently");
}
}
});
return output;
}
exports.convertRunnerOption = convertRunnerOption;
//# sourceMappingURL=handleFilesOption.js.map

@@ -1,4 +0,6 @@

// @ts-check
"use strict";
var path = require("path");
/**
* @type {{controlPanel: {jsFile: string, baseDir: *}, socketIoScript: string, configFile: string, client: {shims: string}}}
*/
module.exports = {

@@ -5,0 +7,0 @@ controlPanel: {

@@ -1,4 +0,2 @@

// @ts-check
"use strict";
// @ts-expect-error
var _ = require("./lodash.custom");

@@ -18,3 +16,3 @@ var fs = require("fs");

* Allow users to disable the Browsersync snippet
* @param {import("immutable").Map} options
* @param {Immutable.Map} options
* @returns {Boolean}

@@ -30,3 +28,3 @@ */

/**
* @param {import("immutable").Map} options
* @param {Immutable.Map} options
* @returns {String}

@@ -56,3 +54,5 @@ */

if (_.isFunction(options.get("scriptPath"))) {
return options.get("scriptPath").apply(null, getScriptArgs(options, scriptPath));
return options
.get("scriptPath")
.apply(null, getScriptArgs(options, scriptPath));
}

@@ -70,3 +70,4 @@ /**

if (scriptDomain.match(/\{port\}/)) {
return scriptDomain.replace("{port}", options.get("port")) + scriptPath;
return (scriptDomain.replace("{port}", options.get("port")) +
scriptPath);
}

@@ -111,3 +112,3 @@ return scriptDomain + scriptPath;

/**
* @param {import("./browser-sync")['options']} options
* @param {Map} options
* @returns {String}

@@ -135,3 +136,3 @@ */

* @param {Object} socketOpts
* @param {import("./browser-sync")['options']} options
* @param {Map} options
* @returns {String|Function}

@@ -150,3 +151,3 @@ */

/**
* @param {import("./browser-sync")['options']} options
* @param {Map} options
* @returns {string}

@@ -177,3 +178,7 @@ */

string = withDomain;
return [options.get("scheme"), "://localhost:", options.get("port")].join("");
return [
options.get("scheme"),
"://localhost:",
options.get("port")
].join("");
}

@@ -197,8 +202,7 @@ if (socketOpts.domain) {

})();
return (string
return string
.replace("{protocol}", protocol)
.replace("{port}", port)
.replace("{domain}", socketOpts.domain.replace("{port}", port))
// @ts-expect-error
.replace("{ns}", namespace));
.replace("{ns}", namespace);
},

@@ -205,0 +209,0 @@ /**

@@ -1,2 +0,1 @@

// @ts-check
/**

@@ -7,5 +6,2 @@ * @module BrowserSync.options

/**
*/
runners: [],
/**
* Browsersync includes a user-interface that is accessed via a separate port.

@@ -27,3 +23,3 @@ * The UI allows to controls all devices, push sync updates and much more.

* @property files
* @type Array|String|false
* @type Array|String
* @default false

@@ -125,3 +121,3 @@ */

* @property middleware
* @type Function|Array|boolean
* @type Function|Array
* @default false

@@ -236,3 +232,3 @@ */

* @property logSnippet
* @type Boolean
* @type: Boolean
* @default true

@@ -437,3 +433,3 @@ * @since 1.5.2

* @property host
* @type String|null
* @type String
* @default null

@@ -440,0 +436,0 @@ */

@@ -1,7 +0,7 @@

// @ts-check
var utils = require("./utils");
/**
* Apply the operators that apply to the 'file:changed' event
* @param {import("rxjs").Observable} subject
* @param {Rx.Observable} subject
* @param options
* @return {Rx.Observable<{type: string, files: Array<any>}>}
*/

@@ -24,3 +24,15 @@ function fileChanges(subject, options) {

const initial = getAggregatedDebouncedStream(subject, options, scheduler);
return applyOperators(operators, initial, options, scheduler);
return applyOperators(operators, initial, options, scheduler).map(function (items) {
const paths = items.map(x => x.path);
if (utils.willCauseReload(paths, options.get("injectFileTypes").toJS())) {
return {
type: "reload",
files: items
};
}
return {
type: "inject",
files: items
};
});
}

@@ -30,4 +42,5 @@ module.exports.fileChanges = fileChanges;

* Apply the operators that apply to the 'browser:reload' event
* @param {import("rxjs").Observable} subject
* @param {Rx.Observable} subject
* @param options
* @returns {Rx.Observable}
*/

@@ -34,0 +47,0 @@ function applyReloadOperators(subject, options) {

@@ -1,12 +0,34 @@

// @ts-check
"use strict";
// @ts-expect-error
var _ = require("./lodash.custom");
var fileUtils = {
/**
* React to file-change events that occur on "core" namespace only
* @param bs
* @param data
*/
changedFile: function (bs, data) {
/**
* If the event property is undefined, infer that it's a 'change'
* event due the fact this handler is for emitter.emit("file:changed")
*/
if (_.isUndefined(data.event)) {
data.event = "change";
}
/**
* Chokidar always sends an 'event' property - which could be
* `add` `unlink` etc etc so we need to check for that and only
* respond to 'change', for now.
*/
if (bs.options.get("watchEvents").indexOf(data.event) > -1) {
if (!bs.paused && data.namespace === "core") {
bs.events.emit("file:reload", fileUtils.getFileInfo(data, bs.options));
}
}
},
/**
* @param data
* @param options
* @returns {import("./types").InjectFileInfo}
* @returns {{assetFileName: *, fileExtension: String}}
*/
getInjectFileInfo: function (data, options) {
getFileInfo: function (data, options) {
data.ext = require("path")

@@ -21,10 +43,11 @@ .extname(data.path)

event: data.event,
type: /** @type {const} */ ("inject")
type: "inject"
};
obj.path = data.path;
obj.log = data.log;
// RELOAD page
if (!_.includes(options.get("injectFileTypes").toJS(), obj.ext)) {
return Object.assign(Object.assign({}, obj), { url: obj.path, type: "reload" });
obj.url = obj.path;
obj.type = "reload";
}
obj.path = data.path;
obj.log = data.log;
return obj;

@@ -31,0 +54,0 @@ }

@@ -1,6 +0,5 @@

// @ts-check
"use strict";
// @ts-expect-error
var _ = require("./lodash.custom");
const { toChangeEvent } = require("./types");
var utils = require("./utils");
var Rx = require("rx");
/**

@@ -15,3 +14,2 @@ * Plugin interface

return options.get("files").reduce(function (map, glob, namespace) {
var jsItem = glob.toJS();
/**

@@ -23,10 +21,9 @@ * Default CB when not given

var fn = function (event, path) {
var _a;
emitter.emit("file:changed", toChangeEvent({
emitter.emit("file:changed", {
event: event,
path: path,
namespace: namespace,
index: (_a = jsItem.index) !== null && _a !== void 0 ? _a : 0
}));
namespace: namespace
});
};
var jsItem = glob.toJS();
if (jsItem.globs.length) {

@@ -33,0 +30,0 @@ var watcher = watch(jsItem.globs, defaultWatchOptions, fn);

@@ -1,3 +0,2 @@

// @ts-check
// @ts-expect-error
"use strict";
var _ = require("./lodash.custom");

@@ -9,3 +8,3 @@ var Immutable = require("immutable");

*
* @this {import("./browser-sync")}
* @this {BrowserSync}
* @returns {String}

@@ -23,3 +22,3 @@ */

/**
* @this {import("./browser-sync")}
* @this {BrowserSync}
* @returns {Array}

@@ -63,3 +62,3 @@ */

* @param {Array} hooks
* @param {import("immutable").Map | import("immutable").List} initial
* @param {Map|List} initial
* @param pluginOptions

@@ -66,0 +65,0 @@ * @returns {any}

@@ -1,2 +0,1 @@

// @ts-check
"use strict";

@@ -36,7 +35,12 @@ var proto = exports;

proto.getUrl = function (args, url) {
return [url, require("./config").httpProtocol.path, "?", serializeParams(args).toString()].join("");
return [
url,
require("./config").httpProtocol.path,
"?",
serializeParams(args).toString()
].join("");
};
/**
* Return a middleware for handling the requests
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @returns {Function}

@@ -55,3 +59,2 @@ */

const [name, payload] = JSON.parse(body.toString());
// @ts-expect-error
bs.io.sockets.emit(name, payload);

@@ -80,4 +83,8 @@ return res.end(`Browsersync HTTP Protocol received: ${name} ${JSON.stringify(payload)}`);

try {
var bsOrEmitter = methodRequiresInstance(params.method) ? bs : bs.events;
require("./public/" + params.method)(bsOrEmitter).apply(null, [params.args]);
var bsOrEmitter = methodRequiresInstance(params.method)
? bs
: bs.events;
require("./public/" + params.method)(bsOrEmitter).apply(null, [
params.args
]);
output = [

@@ -84,0 +91,0 @@ "Called public API method `.%s()`".replace("%s", params.method),

#! /usr/bin/env node
// @ts-check
"use strict";
/**
* @module BrowserSync
*/
// @ts-expect-error
var pjson = require("../package.json");

@@ -20,3 +19,3 @@ var BrowserSync = require("./browser-sync");

/**
* @type {boolean|import("events").EventEmitter}
* @type {boolean|EventEmitter}
*/

@@ -77,3 +76,3 @@ var singletonEmitter = false;

*/
module.exports.use = function (name, module, cb) {
module.exports.use = function () {
var args = Array.prototype.slice.call(arguments);

@@ -109,3 +108,3 @@ singletonPlugins.push({

* @method notify
* @param {String} msg Can be a simple message such as 'Connected' or HTML
* @param {String|HTML} msg Can be a simple message such as 'Connected' or HTML
* @param {Number} [timeout] How long the message will remain in the browser. @since 1.3.0

@@ -179,3 +178,3 @@ */

* Event emitter factory
* @returns {import("events").EventEmitter}
* @returns {EventEmitter}
*/

@@ -189,7 +188,6 @@ function newEmitter() {

* Get the singleton's emitter, or a new one.
* @returns {import("events").EventEmitter}
* @returns {EventEmitter}
*/
function getSingletonEmitter() {
if (singletonEmitter) {
// @ts-expect-error
return singletonEmitter;

@@ -238,11 +236,8 @@ }

var args = Array.prototype.slice.call(arguments);
// @ts-expect-error
singleton = create("singleton", getSingletonEmitter());
if (singletonPlugins.length) {
singletonPlugins.forEach(function (obj) {
// @ts-expect-error
singleton.instance.registerPlugin.apply(singleton.instance, obj.args);
});
}
// @ts-expect-error
singleton.init.apply(null, args);

@@ -281,3 +276,3 @@ return singleton;

* @param {String} [name]
* @param {import("events").EventEmitter} [emitter]
* @param {EventEmitter} [emitter]
* @returns {{init: *, exit: (exit|exports), notify: *, reload: *, cleanup: *, emitter: (Browsersync.events|*), use: *}}

@@ -305,3 +300,4 @@ */

* @param {String} [name]
* @param {import("events").EventEmitter} [emitter]
* @param {EventEmitter} [emitter]
* @returns {{init: *, exit: (exit|exports), notify: *, reload: *, cleanup: *, emitter: (Browsersync.events|*), use: *}}
*/

@@ -328,5 +324,3 @@ module.exports.create = create;

};
// @ts-expect-error
browserSync.publicInstance = instance;
// @ts-expect-error
instance.init = require("./public/init")(browserSync, name, pjson);

@@ -357,3 +351,2 @@ Object.defineProperty(instance, "active", {

else {
// @ts-expect-error
return browserSync.io.sockets;

@@ -360,0 +353,0 @@ }

@@ -1,13 +0,8 @@

// @ts-check
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const runner_1 = require("./runner");
var utils = require("./utils");
var fileUtils = require("./file-utils");
var Rx = require("rx");
var z = require("zod");
var fromEvent = Rx.Observable.fromEvent;
var fileHandler = require("./file-event-handler");
const { toRunnerOption, toRunnerNotification, toSideEffect, FileChangedEvent, toReloadEvent } = require("./types");
function internalEvents(bs) {
module.exports = function (bs) {
var events = {

@@ -28,8 +23,2 @@ /**

/**
* HTML Injection
*/
"browser:inject-html": function (data) {
bs.io.sockets.emit("browser:inject-html", data);
},
/**
* Browser Notify

@@ -48,3 +37,6 @@ * @param data

var open = bs.options.get("open");
if (mode === "proxy" || mode === "server" || open === "ui" || open === "ui-external") {
if (mode === "proxy" ||
mode === "server" ||
open === "ui" ||
open === "ui-external") {
utils.openBrowser(data.url, bs.options, bs);

@@ -103,99 +95,19 @@ }

.fileChanges(coreNamespacedWatchers, bs.options)
.map(function (/** @type {FileChangedEvent[]} */ items) {
const paths = items.map(x => x.path);
console.log(JSON.stringify(items, null, 2));
if (utils.willCauseReload(paths, bs.options.get("injectFileTypes").toJS())) {
return toSideEffect({
type: "reload",
files: items
.subscribe(function (x) {
if (x.type === "reload") {
bs.events.emit("browser:reload", x);
}
if (x.type === "inject") {
x.files.forEach(function (data) {
if (!bs.paused && data.namespace === "core") {
bs.events.emit("file:reload", fileUtils.getFileInfo(data, bs.options));
}
});
}
return toSideEffect({
type: "inject",
files: items
});
})
.subscribe(function (/** @type {import("./types").BsSideEffect} */ effect) {
bsSideEffect(effect);
});
const runnerWatchers = fromEvent(bs.events, "file:changed").filter(function (x) {
var _a;
return (_a = x.namespace) === null || _a === void 0 ? void 0 : _a.startsWith("__unstable_runner");
});
var runnerHandler = fileHandler
.fileChanges(runnerWatchers, bs.options)
.flatMapFirst(
/** @type {FileChangedEvent[]} */ events => {
if (!events || events.length === 0) {
console.log("missing events..");
return Rx.Observable.empty();
}
const uniqueCount = new Set(events.map(e => e.index)).size;
if (uniqueCount > 1) {
console.warn("overlapping watchers not supported yet");
return Rx.Observable.empty();
}
const matchingRunner = bs.options
.get("runners")
.get(events[0].index)
.toJS();
const parsed = toRunnerOption(matchingRunner);
if (!parsed)
return Rx.Observable.empty();
const runner = (0, runner_1.execRunner)(parsed);
return runner.catch(e => {
// todo: handle/print errors nicely
bs.events.emit("runners:runtime-error", { runner, error: e });
return Rx.Observable.empty();
});
})
.subscribe(sideEffects);
function sideEffects(/** @type {import("./types").RunnerNotification} */ statusNotification) {
switch (statusNotification.status) {
case "start": {
console.log(statusNotification);
break;
}
case "end": {
statusNotification.effects.forEach(effect => {
console.log("effect...", effect);
bsSideEffect(effect);
});
break;
}
}
}
/**
* @param {import("./types").BsSideEffect} effect
*/
function bsSideEffect(effect) {
switch (effect.type) {
case "inject-html": {
bs.events.emit("browser:inject-html", { selectors: effect.selectors });
break;
}
case "reload": {
bs.events.emit("browser:reload", toReloadEvent({
files: effect.files
}));
break;
}
case "inject": {
effect.files.forEach(function (data) {
if (!bs.paused) {
const injectInfo = fileUtils.getInjectFileInfo(data, bs.options);
bs.events.emit("file:reload", injectInfo);
}
});
break;
}
}
}
bs.registerCleanupTask(function () {
handler.dispose();
reloader.dispose();
runnerHandler.dispose();
});
}
exports.default = internalEvents;
};
//# sourceMappingURL=internal-events.js.map

@@ -1,10 +0,7 @@

// @ts-check
"use strict";
var messages = require("./connect-utils");
var utils = require("./utils");
// @ts-expect-error
var _ = require("./lodash.custom");
var chalk = require("chalk");
const { toReloadEvent } = require("./types");
var template = prefix => "[" + chalk.blue(prefix) + "] ";
var template = (prefix) => "[" + chalk.blue(prefix) + "] ";
var logger = require("eazy-logger").Logger({

@@ -30,3 +27,3 @@ useLevelPrefixes: false

* Log when file-watching has started
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param data

@@ -41,3 +38,3 @@ */

* Log when a file changes
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param data

@@ -62,13 +59,9 @@ */

*/
"browser:reload": function (bs, data = { files: [] }) {
try {
if (canLogFileChange(bs)) {
const evt = toReloadEvent(data);
if (evt.files && evt.files.length > 1) {
return logger.info(chalk.cyan(`Reloading Browsers... (buffered %s events)`), evt.files.length);
}
logger.info(chalk.cyan("Reloading Browsers..."));
"browser:reload": function (bs, data = {}) {
if (canLogFileChange(bs)) {
if (data.files && data.files.length > 1) {
return logger.info(chalk.cyan(`Reloading Browsers... (buffered %s events)`), data.files.length);
}
logger.info(chalk.cyan("Reloading Browsers..."));
}
catch (e) { }
},

@@ -83,3 +76,3 @@ /**

/**
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param data

@@ -95,3 +88,3 @@ */

* Client connected logging
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param data

@@ -110,3 +103,3 @@ */

* Main logging when the service is running
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param data

@@ -141,3 +134,3 @@ */

if (bs.options.get("logSnippet")) {
logger.info(chalk.bold(`Copy the following snippet into your website, just before the closing ${chalk.cyan("</body>")} tag`));
logger.info(chalk.bold(`Copy the following snippet into your website, just before the closing ${chalk.cyan('</body>')} tag`));
logger.unprefixed("info", messages.scriptTags(bs.options));

@@ -159,4 +152,4 @@ }

* Plugin interface for BrowserSync
* @param {import("events").EventEmitter} emitter
* @param {import("./browser-sync")} bs
* @param {EventEmitter} emitter
* @param {BrowserSync} bs
* @returns {Object}

@@ -252,3 +245,3 @@ */

* @param bs
* @param [data]
* @param data
* @returns {boolean}

@@ -255,0 +248,0 @@ */

@@ -126,3 +126,6 @@ "use strict";

if (incoming.get("extensions")) {
return [incoming.setIn(optPath.concat(["extensions"]), incoming.get("extensions")), []];
return [
incoming.setIn(optPath.concat(["extensions"]), incoming.get("extensions")),
[]
];
}

@@ -153,3 +156,6 @@ return [incoming, []];

ignorePaths = ignorePaths.map(ensureSlash);
return [incoming.setIn(["snippetOptions", "blacklist"], Immutable.List(ignorePaths)), []];
return [
incoming.setIn(["snippetOptions", "blacklist"], Immutable.List(ignorePaths)),
[]
];
}

@@ -163,3 +169,6 @@ return [incoming, []];

includePaths = includePaths.map(ensureSlash);
return [incoming.setIn(["snippetOptions", "whitelist"], Immutable.List(includePaths)), []];
return [
incoming.setIn(["snippetOptions", "whitelist"], Immutable.List(includePaths)),
[]
];
}

@@ -166,0 +175,0 @@ return [incoming, []];

@@ -1,2 +0,1 @@

// @ts-check
var Immutable = require("immutable");

@@ -3,0 +2,0 @@ var Map = Immutable.Map;

@@ -1,5 +0,4 @@

// @ts-check
"use strict";
/**
* @param {import("../browser-sync")} browserSync
* @param {BrowserSync} browserSync
* @returns {Function}

@@ -6,0 +5,0 @@ */

@@ -1,5 +0,4 @@

// @ts-check
"use strict";
/**
* @param {import("../browser-sync")} browserSync
* @param {BrowserSync} browserSync
* @returns {Function}

@@ -6,0 +5,0 @@ */

@@ -1,5 +0,4 @@

// @ts-check
"use strict";
/**
* @param {import("../browser-sync")} browserSync
* @param {BrowserSync} browserSync
* @returns {Function}

@@ -6,0 +5,0 @@ */

@@ -1,10 +0,7 @@

// @ts-check
"use strict";
// @ts-expect-error
var _ = require("../lodash.custom");
const { toChangeEvent } = require("../types");
module.exports = {
/**
* Emit the internal `file:change` event
* @param {import("events").EventEmitter} emitter
* @param {EventEmitter} emitter
* @param {string} path

@@ -14,3 +11,3 @@ * @param {boolean} [log]

emitChangeEvent: function emitChangeEvent(emitter, path, log) {
emitter.emit("file:changed", toChangeEvent({
emitter.emit("file:changed", {
path: path,

@@ -20,7 +17,7 @@ log: log,

event: "change"
}));
});
},
/**
* Emit the internal `browser:reload` event
* @param {import("events").EventEmitter} emitter
* @param {EventEmitter} emitter
*/

@@ -32,3 +29,3 @@ emitBrowserReload: function emitChangeEvent(emitter) {

* Emit the internal `stream:changed` event
* @param {import("events").EventEmitter} emitter
* @param {EventEmitter} emitter
* @param {Array} changed

@@ -35,0 +32,0 @@ */

@@ -1,6 +0,4 @@

// @ts-check
"use strict";
var utils = require("../utils");
var publicUtils = require("./public-utils");
// @ts-expect-error
var _ = require("../lodash.custom");

@@ -7,0 +5,0 @@ var defaultConfig = require("../default-config");

@@ -1,5 +0,4 @@

// @ts-check
"use strict";
/**
* @param {import("../browser-sync")} browserSync
* @param {BrowserSync} browserSync
* @returns {Function}

@@ -6,0 +5,0 @@ */

@@ -1,2 +0,1 @@

// @ts-check
"use strict";

@@ -15,6 +14,5 @@ var path = require("path");

* @param {{once: boolean, match: string|array}} [opts]
* @returns {import("stream").Transform}
* @returns {Stream.Transform}
*/
function browserSyncThroughStream(opts) {
// @ts-expect-error
opts = opts || {};

@@ -40,5 +38,3 @@ var emitted = false;

*/
// @ts-expect-error
if (opts.match) {
// @ts-expect-error
if (!micromatch(file.path, opts.match, { dot: true }).length) {

@@ -52,3 +48,2 @@ return end();

*/
// @ts-expect-error
if (opts.once === true && !emitted) {

@@ -60,3 +55,2 @@ utils.emitBrowserReload(emitter);

// handle multiple
// @ts-expect-error
if (opts.once === true && emitted) {

@@ -80,3 +74,2 @@ }

*/
// @ts-expect-error
reload._flush = function (next) {

@@ -83,0 +76,0 @@ if (changed.length) {

@@ -1,5 +0,3 @@

// @ts-check
"use strict";
var enableDestroy = require("server-destroy");
// @ts-expect-error
var _ = require("../lodash.custom");

@@ -61,3 +59,4 @@ /**

* Launch the server for serving the client JS plus static files
* @param {import("../browser-sync")} bs
* @param {BrowserSync} bs
* @returns {{staticServer: (http.Server), proxyServer: (http.Server)}}
*/

@@ -64,0 +63,0 @@ function createServer(bs) {

@@ -1,2 +0,1 @@

// @ts-check
"use strict";

@@ -59,3 +58,4 @@ var httpProxy = require("http-proxy");

/**
* @param {import("../browser-sync")} bs
* @param {BrowserSync} bs
* @param {String} scripts
* @returns {*}

@@ -62,0 +62,0 @@ */

@@ -1,2 +0,1 @@

// @ts-check
var url = require("url");

@@ -80,3 +79,9 @@ module.exports.rewriteLinks = function (userServer) {

*/
return [captured, pre, proxyUrl, out.path || "", out.hash || ""].join("");
return [
captured,
pre,
proxyUrl,
out.path || "",
out.hash || ""
].join("");
}

@@ -83,0 +88,0 @@ };

@@ -1,2 +0,1 @@

// @ts-check
"use strict";

@@ -7,9 +6,10 @@ var connect = require("connect");

* Create a server for the snippet
* @param {import("../browser-sync")} bs
* @param {BrowserSync} bs
* @param scripts
* @returns {*}
*/
module.exports = function createSnippetServer(bs) {
var app = serverUtils.getBaseApp(bs);
module.exports = function createSnippetServer(bs, scripts) {
var app = serverUtils.getBaseApp(bs, bs.options, scripts);
return serverUtils.getServer(app, bs.options);
};
//# sourceMappingURL=snippet-server.js.map

@@ -1,2 +0,1 @@

// @ts-check
var serverUtils = require("./utils.js");

@@ -8,3 +7,3 @@ var resolve = require("path").resolve;

/**
* @param {import("../browser-sync")} bs
* @param {BrowserSync} bs
* @returns {*}

@@ -43,3 +42,4 @@ */

route: "",
id: "Browsersync Server ServeStatic Middleware - " + _serveStatic++,
id: "Browsersync Server ServeStatic Middleware - " +
_serveStatic++,
handle: serveStatic(resolve(root), serveStaticOptions)

@@ -63,3 +63,4 @@ };

route: urlPath,
id: "Browsersync Server Routes Middleware - " + _routes++,
id: "Browsersync Server Routes Middleware - " +
_routes++,
handle: serveStatic(resolve(root))

@@ -66,0 +67,0 @@ };

@@ -1,2 +0,1 @@

// @ts-check
"use strict";

@@ -14,3 +13,2 @@ var fs = require("fs");

var snippet = require("./../snippet").utils;
// @ts-expect-error
var _ = require("../lodash.custom");

@@ -62,2 +60,3 @@ var serveStatic = require("./serve-static-wrapper").default();

* @param options
* @returns {{key, cert}}
*/

@@ -82,3 +81,4 @@ getHttpsOptions: function (options) {

var httpModule = serverUtils.getHttpModule(options);
if (options.get("scheme") === "https" || options.get("httpModule") === "http2") {
if (options.get("scheme") === "https" ||
options.get("httpModule") === "http2") {
var opts = serverUtils.getHttpsOptions(options);

@@ -178,3 +178,3 @@ return httpModule.createServer(opts.toJS(), app);

withErrors.forEach(function (item) {
logger.logger.error("%s %s", require("chalk").red("Warning!"), item.getIn(["errors", 0, "data", "message"]));
logger.logger.error("%s %s", chalk.red("Warning!"), item.getIn(["errors", 0, "data", "message"]));
});

@@ -212,3 +212,2 @@ }

const mwStack = []
// @ts-expect-error
.concat(beforeMiddlewares, defaultMiddlewares, afterMiddlewares)

@@ -324,3 +323,3 @@ .filter(Boolean);

if (Immutable.Map.isMap(dir)) {
return getFromMap(dir);
return getFromMap(dir, i);
}

@@ -415,10 +414,9 @@ /**

}
// @ts-expect-error
return route.reduce(function (acc, routeString) {
/**
* For each 'route' item, also iterate through 'dirs'
* @type {Immutable.Iterable<K, M>}
*/
var perDir = _dir.map(function (dirString) {
return Map({
// @ts-expect-error
route: getRoute(routeString),

@@ -428,3 +426,2 @@ dir: dirString

});
// @ts-expect-error
return acc.concat(perDir);

@@ -431,0 +428,0 @@ }, List([]));

@@ -1,2 +0,1 @@

// @ts-check
"use strict";

@@ -6,3 +5,3 @@ var connectUtils = require("./connect-utils");

var lrSnippet = require("resp-modifier");
// @ts-expect-error
var path = require("path");
var _ = require("./lodash.custom");

@@ -35,3 +34,3 @@ var utils = require("./utils");

* @param {Object} options
* @returns {{match: RegExp, fn: Function, once: boolean, id: string}}
* @returns {{match: RegExp, fn: Function}}
*/

@@ -64,2 +63,3 @@ getRegex: function (snippet, options) {

/**
* @param {Object} req
* @param {Array} [excludeList]

@@ -74,3 +74,2 @@ * @returns {Object}

if (parseInt(match[1], 10) < 9) {
// @ts-expect-error
if (!snippetUtils.isExcluded(req.url, excludeList)) {

@@ -86,4 +85,4 @@ req.headers["accept"] = "text/html";

* @param {Number} port
* @param {import("./browser-sync")['options']} options
* @returns {() => string}
* @param {BrowserSync.options} options
* @returns {String}
*/

@@ -90,0 +89,0 @@ getClientJs: function (port, options) {

@@ -17,3 +17,3 @@ "use strict";

* @param clientEvents
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
*/

@@ -23,3 +23,4 @@ function init(server, clientEvents, bs) {

var socketConfig = bs.options.get("socket").toJS();
if (bs.options.get("mode") === "proxy" && bs.options.getIn(["proxy", "ws"])) {
if (bs.options.get("mode") === "proxy" &&
bs.options.getIn(["proxy", "ws"])) {
server = utils.getServer(null, bs.options).server;

@@ -36,7 +37,7 @@ server.listen(bs.options.getIn(["socket", "port"]));

credentials: true,
origin: (origin, cb) => {
"origin": (origin, cb) => {
return cb(null, origin);
}
},
} }));
io.of(socketConfig.namespace).on("connection", socket => {
io.of(socketConfig.namespace).on('connection', (socket) => {
handleConnection(socket);

@@ -43,0 +44,0 @@ });

@@ -1,8 +0,6 @@

// @ts-check
"use strict";
// @ts-expect-error
var _ = require("./lodash.custom");
var utils = require("util");
/**
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
* @param {Function} cb

@@ -9,0 +7,0 @@ */

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toReloadEvent = exports.toChangeEvent = exports.toRunnerNotification = exports.toSideEffect = exports.toRunnerOption = exports.runnerOption = exports.runtimeRunnerOption = exports.triggerSchema = exports.startupRunnerOption = void 0;
const zod_1 = require("zod");
const runnerParser = zod_1.z.union([
zod_1.z.object({
sh: zod_1.z.string()
}),
zod_1.z.object({
bs: zod_1.z.literal("reload")
}),
zod_1.z.object({
bs: zod_1.z.literal("inject"),
files: zod_1.z.array(zod_1.z.string())
}),
zod_1.z.object({
bs: zod_1.z.literal("inject-html"),
selectors: zod_1.z.array(zod_1.z.string()).default([])
}),
zod_1.z.object({
npm: zod_1.z.array(zod_1.z.string()),
parallel: zod_1.z.boolean().optional()
})
]);
exports.startupRunnerOption = zod_1.z.object({
at: zod_1.z.literal("startup"),
run: zod_1.z.array(runnerParser)
});
exports.triggerSchema = zod_1.z.union([
zod_1.z.object({ files: zod_1.z.array(zod_1.z.string()) }),
zod_1.z.object({ bs: zod_1.z.literal("started") })
]);
exports.runtimeRunnerOption = zod_1.z.object({
at: zod_1.z.literal("runtime"),
when: zod_1.z.array(exports.triggerSchema),
run: zod_1.z.array(runnerParser)
});
exports.runnerOption = zod_1.z.discriminatedUnion("at", [exports.startupRunnerOption, exports.runtimeRunnerOption]);
function toRunnerOption(input) {
const parsed = exports.runnerOption.safeParse(input);
// todo: give good errors on format mistakes here
return parsed.success ? parsed.data : null;
}
exports.toRunnerOption = toRunnerOption;
const sideEffectParser = zod_1.z.discriminatedUnion("type", [
zod_1.z.object({ type: zod_1.z.literal("reload"), files: zod_1.z.array(zod_1.z.any()) }),
zod_1.z.object({ type: zod_1.z.literal("inject"), files: zod_1.z.array(zod_1.z.any()) }),
zod_1.z.object({ type: zod_1.z.literal("inject-html"), selectors: zod_1.z.array(zod_1.z.string()) })
]);
function toSideEffect(sideEffect) {
return sideEffectParser.parse(sideEffect);
}
exports.toSideEffect = toSideEffect;
const notificationParser = zod_1.z.discriminatedUnion("status", [
zod_1.z.object({
runner: runnerParser,
status: zod_1.z.literal("start"),
effects: zod_1.z.array(sideEffectParser)
}),
zod_1.z.object({ runner: runnerParser, status: zod_1.z.literal("end"), effects: zod_1.z.array(sideEffectParser) })
]);
function toRunnerNotification(input) {
return notificationParser.parse(input);
}
exports.toRunnerNotification = toRunnerNotification;
///
const fileChangedEventParser = zod_1.z.object({
event: zod_1.z.string(),
path: zod_1.z.string(),
log: zod_1.z.boolean().optional(),
namespace: zod_1.z.string(),
index: zod_1.z.number().optional()
});
function toChangeEvent(evt) {
return fileChangedEventParser.parse(evt);
}
exports.toChangeEvent = toChangeEvent;
/// Browser Reload Event
const browserReloadEvent = zod_1.z.object({
files: zod_1.z.array(zod_1.z.union([zod_1.z.string(), fileChangedEventParser]))
});
function toReloadEvent(reload) {
browserReloadEvent.parse(reload);
return reload;
}
exports.toReloadEvent = toReloadEvent;
/// Inject File info
const injectFileInfo = zod_1.z.object({
ext: zod_1.z.string(),
path: zod_1.z.string(),
basename: zod_1.z.string(),
event: zod_1.z.unknown(),
type: zod_1.z.enum(["inject", "reload"]),
url: zod_1.z.string().optional(),
log: zod_1.z.unknown() // You may want to replace this with a more specific type
});
//# sourceMappingURL=types.js.map

@@ -138,3 +138,3 @@ "use strict";

* @param {Object} options
* @param {import("./browser-sync")} bs
* @param {BrowserSync} bs
*/

@@ -248,3 +248,2 @@ function openBrowser(url, options, bs) {

if (options.get("server") && options.get("proxy")) {
// @ts-expect-error
errors.push(messages["server+proxy"]);

@@ -251,0 +250,0 @@ }

{
"name": "browser-sync",
"description": "Live CSS Reload & Browser Syncing",
"version": "2.30.0-alpha.3",
"homepage": "https://browsersync.io/",
"author": {
"name": "Shane Osbourne"
},
"repository": "BrowserSync/browser-sync",
"license": "Apache-2.0",
"main": "dist/index.js",
"bin": "dist/bin.js",
"files": [
"dist",
"certs",
"templates",
"cli-options",
"client/dist"
],
"engines": {
"node": ">= 8.0.0"
},
"scripts": {
"build": "npm run build.tsc",
"build.tsc": "tsc",
"build.esbuild": "node build.js",
"build:watch": "tsc --watch",
"env": "node ./test/env.js",
"lodash": "lodash include=isUndefined,isFunction,toArray,includes,union,each,isString,merge,isObject,set exports=node",
"prepublishOnly": "npm run build",
"test": "npm run build && npm run env && npm run unit",
"unit": "mocha --recursive test/specs --timeout 10000 --bail --exit",
"watch": "npm run build && npm run serve:fixtures",
"serve:fixtures": "node dist/bin test/fixtures -w --no-open"
},
"dependencies": {
"browser-sync-client": "^2.30.0-alpha.3",
"browser-sync-ui": "^2.30.0-alpha.3",
"bs-recipes": "1.3.4",
"chalk": "4.1.2",
"chokidar": "^3.5.1",
"connect": "3.6.6",
"connect-history-api-fallback": "^1",
"dev-ip": "^1.0.1",
"easy-extender": "^2.3.4",
"eazy-logger": "^4.0.1",
"etag": "^1.8.1",
"fresh": "^0.5.2",
"fs-extra": "3.0.1",
"http-proxy": "^1.18.1",
"immutable": "^3",
"localtunnel": "^2.0.1",
"micromatch": "^4.0.2",
"npm-run-all": "^4.1.5",
"opn": "5.3.0",
"portscanner": "2.2.0",
"raw-body": "^2.3.2",
"resp-modifier": "6.0.2",
"rx": "4.1.0",
"send": "0.16.2",
"serve-index": "1.9.1",
"serve-static": "1.13.2",
"server-destroy": "1.0.1",
"socket.io": "^4.4.1",
"ua-parser-js": "^1.0.33",
"yargs": "^17.3.1",
"zod": "^3.21.4"
},
"devDependencies": {
"@types/node": "^8",
"bs-snippet-injector": "^2.0.1",
"chai": "^3",
"generate-changelog": "^1.7.0",
"graceful-fs": "4.1.9",
"http2": "^3.3.6",
"mocha": "^10.2.0",
"q": "1.4.1",
"request": "^2",
"requirejs": "^2.3.5",
"rimraf": "2.5.4",
"sinon": "^1",
"socket.io-client": "^2.4.0",
"source-map-support": "^0.5.0",
"strip-ansi": "^6.0.1",
"supertest": "^3",
"typescript": "^4.6.2",
"vinyl": "1.2.0"
},
"keywords": [
"browser sync",
"css",
"live reload",
"sync"
],
"gitHead": "b85a28ba9982f33db8a4e49de8a5103376a9c2ef"
"name": "browser-sync",
"description": "Live CSS Reload & Browser Syncing",
"version": "3.0.0-alpha.0",
"homepage": "https://browsersync.io/",
"author": {
"name": "Shane Osbourne"
},
"repository": "BrowserSync/browser-sync",
"license": "Apache-2.0",
"main": "dist/index.js",
"bin": "dist/bin.js",
"files": [
"dist",
"certs",
"templates",
"cli-options",
"client/dist"
],
"engines": {
"node": ">= 8.0.0"
},
"scripts": {
"build": "npm run build:server",
"build:server": "tsc",
"build:watch": "tsc --watch",
"env": "node ./test/env.js",
"lodash": "lodash include=isUndefined,isFunction,toArray,includes,union,each,isString,merge,isObject,set exports=node",
"prepublishOnly": "npm run build",
"prettier": "prettier 'lib/**/*' 'examples/*' 'test/specs/**/*.js' --tab-width 4",
"prettier:fix": "npm run prettier -- --write",
"test": "npm run build && npm run env && npm run unit",
"unit": "mocha --recursive test/specs --timeout 10000 --bail --exit",
"watch": "npm run build && npm run serve:fixtures",
"serve:fixtures": "node dist/bin test/fixtures -w --no-open"
},
"dependencies": {
"browser-sync-client": "^3.0.0-alpha.0",
"browser-sync-ui": "^3.0.0-alpha.0",
"bs-recipes": "1.3.4",
"chalk": "4.1.2",
"chokidar": "^3.5.1",
"connect": "3.6.6",
"connect-history-api-fallback": "^1",
"dev-ip": "^1.0.1",
"easy-extender": "^2.3.4",
"eazy-logger": "^4.0.1",
"etag": "^1.8.1",
"fresh": "^0.5.2",
"fs-extra": "3.0.1",
"http-proxy": "^1.18.1",
"immutable": "^3",
"micromatch": "^4.0.2",
"opn": "5.3.0",
"portscanner": "2.2.0",
"raw-body": "^2.3.2",
"resp-modifier": "6.0.2",
"rx": "4.1.0",
"send": "0.16.2",
"serve-index": "1.9.1",
"serve-static": "1.13.2",
"server-destroy": "1.0.1",
"socket.io": "^4.4.1",
"ua-parser-js": "^1.0.33",
"yargs": "^17.3.1"
},
"devDependencies": {
"@types/node": "^8",
"bs-snippet-injector": "^2.0.1",
"chai": "^3",
"generate-changelog": "^1.7.0",
"graceful-fs": "4.1.9",
"http2": "^3.3.6",
"mocha": "^10.2.0",
"prettier": "^1.9.2",
"q": "1.4.1",
"request": "^2",
"requirejs": "^2.3.5",
"rimraf": "2.5.4",
"sinon": "^1",
"socket.io-client": "^2.4.0",
"source-map-support": "^0.5.0",
"strip-ansi": "^6.0.1",
"supertest": "^3",
"typescript": "^4.6.2",
"vinyl": "1.2.0"
},
"peerDependencies": {
"localtunnel": "^2.0.2"
},
"keywords": [
"browser sync",
"css",
"live reload",
"sync"
],
"gitHead": "ab5f75be8b3865b2f737e522e2dcae2101eeaaa2"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc