Skip to content

Commit

Permalink
Merge branch 'socket-io-update' - fixes #1392
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane committed Dec 20, 2017
2 parents 3645283 + ef92799 commit ba93a88
Show file tree
Hide file tree
Showing 72 changed files with 19,627 additions and 82 deletions.
4 changes: 4 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
npm-debug.log
test/coverage
example.proxy.js
11 changes: 11 additions & 0 deletions client/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sudo: false
git:
depth: 2
language: node_js
node_js:
- node
- '4.0.0'
before_script:
- "npm install -g gulp"
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
22 changes: 22 additions & 0 deletions client/LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2013 Shane Osbourne

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:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
19 changes: 19 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# browser-sync-client [![Build Status](https://travis-ci.org/BrowserSync/browser-sync-client.svg)](https://travis-ci.org/BrowserSync/browser-sync-client)

Client-side script for BrowserSync

## Contributors

```
177 Shane Osbourne
2 Sergey Slipchenko
1 Hugo Dias
1 Shinnosuke Watanabe
1 Tim Schaub
1 Shane Daniel
1 Matthieu Vachon
```

## License
Copyright (c) 2014 Shane Osbourne
Licensed under the MIT license.
86 changes: 86 additions & 0 deletions client/cbfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
var cb = require("crossbow");
var vfs = require("vinyl-fs");
var jshint = require("gulp-jshint");
var uglify = require("gulp-uglify");
var contribs = require("gulp-contribs");
var through2 = require("through2");
var rename = require("gulp-rename");
var browserify = require("browserify");
var source = require("vinyl-source-stream");

cb.task("lint-test", function lintTest() {
return vfs.src(["test/client-new/*.js", "test/middleware/*.js", "cbfile.js"])
.pipe(jshint("test/.jshintrc"))
.pipe(jshint.reporter("default"))
.pipe(jshint.reporter("fail"));
});

cb.task("lint-lib", function lintLib() {
return vfs.src(["lib/*", "!lib/browser-sync-client.js", "!lib/events.js", "!lib/client-shims.js"])
.pipe(jshint("lib/.jshintrc"))
.pipe(jshint.reporter("default"))
.pipe(jshint.reporter("fail"));
});

cb.task("contribs", function contribs() {
return vfs.src("README.md")
.pipe(contribs())
.pipe(vfs.dest("./"));
});

/**
* Strip debug statements
* @returns {*}
*/
var stripDebug = function () {
var chunks = [];
return through2.obj(function (file, enc, cb) {
chunks.push(file);
var string = file._contents.toString();
var regex = /\/\*\*debug:start\*\*\/[\s\S]*\/\*\*debug:end\*\*\//g;
var stripped = string.replace(regex, "");
file.contents = new Buffer(stripped);
this.push(file);
cb();
});
};

cb.task("bundle", function bundle() {
return browserify("./lib/index.js")
.bundle()
.pipe(source("index.js"))
.pipe(vfs.dest("./dist"));
});

cb.task("minify", function minify() {
return vfs.src(["dist/index.js"])
.pipe(stripDebug())
.pipe(rename("index.min.js"))
.pipe(uglify())
.pipe(vfs.dest("./dist"));
});

cb.task("build-all", ["bundle", "minify"]);

cb.task("dev", {
description: "Build-all & then watch for changes",
tasks: [
"build-all",
function () {
cb.watch(["lib/*.js", "test/client-new/**/*.js"], ["build-all"], {block: true});
}
]
});

cb.task("default", ["lint-lib", "lint-test", "build-all"]);

cb.group("karma", {
watch: "@npm karma start test/karma.conf.js",
unit: "@npm karma start test/karma.conf.ci.js"
});

cb.task("test", [
"default",
"@npm mocha test/middleware",
"karma:unit"
]);
Empty file added client/dist/.gitkeep
Empty file.

0 comments on commit ba93a88

Please sign in to comment.