Skip to content

Commit 9d2473c

Browse files
committed
v15.0.0 - Rename asyngular to socketcluster
1 parent cff096d commit 9d2473c

11 files changed

+129
-118
lines changed

README.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
Asyngular JavaScript client
1+
SocketCluster JavaScript client
22
======
33

4-
Client module for Asyngular.
4+
Client module for SocketCluster.
55

66
## Setting up
77

8-
You will need to install both ```asyngular-client``` and ```asyngular-server``` (https://github.com/SocketCluster/asyngular-server).
8+
You will need to install both ```socketcluster-client``` and ```socketcluster-server``` (https://github.com/SocketCluster/socketcluster-server).
99

1010
To install this module:
1111
```bash
12-
npm install asyngular-client
12+
npm install socketcluster-client
1313
```
1414

1515
## How to use
1616

17-
The asyngular-client script is called `asyngular-client.js` (located in the main asyngular-client directory).
17+
The socketcluster-client script is called `socketcluster-client.js` (located in the main socketcluster-client directory).
1818
Embed it in your HTML page like this:
1919
```html
20-
<script type="text/javascript" src="/asyngular-client.js"></script>
20+
<script type="text/javascript" src="/socketcluster-client.js"></script>
2121
```
2222
\* Note that the src attribute may be different depending on how you setup your HTTP server.
2323

24-
Once you have embedded the client `asyngular-client.js` into your page, you will gain access to a global `asyngularClient` object.
24+
Once you have embedded the client `socketcluster-client.js` into your page, you will gain access to a global `socketClusterClient` object.
2525
You may also use CommonJS `require` or ES6 module imports.
2626

2727
### Connect to a server
2828

2929
```js
30-
let socket = asyngularClient.create({
30+
let socket = socketClusterClient.create({
3131
hostname: 'localhost',
3232
port: 8000
3333
});
@@ -138,19 +138,19 @@ let options = {
138138
rejectUnauthorized: false // Only necessary during debug if using a self-signed certificate
139139
};
140140
// Initiate the connection to the server
141-
let socket = asyngularClient.create(options);
141+
let socket = socketClusterClient.create(options);
142142
```
143143

144-
For more detailed examples of how to use Asyngular, see `test/integration.js`.
145-
Also, see tests from the `asyngular-server` module.
144+
For more detailed examples of how to use SocketCluster, see `test/integration.js`.
145+
Also, see tests from the `socketcluster-server` module.
146146

147147
### Connect Options
148148

149-
See all available options: https://asyngular.io/docs/api-asyngular-client/
149+
See all available options: https://socketcluster.io/
150150

151151
```js
152152
let options = {
153-
path: '/asyngular/',
153+
path: '/socketcluster/',
154154
port: 8000,
155155
hostname: '127.0.0.1',
156156
autoConnect: true,
@@ -177,8 +177,8 @@ let options = {
177177

178178
## Running the tests
179179

180-
- Clone this repo: `git clone [email protected]:SocketCluster/asyngular-client.git`
181-
- Navigate to project directory: `cd asyngular-client`
180+
- Clone this repo: `git clone [email protected]:SocketCluster/socketcluster-client.git`
181+
- Navigate to project directory: `cd socketcluster-client`
182182
- Install all dependencies: `npm install`
183183
- Run the tests: `npm test`
184184

@@ -187,7 +187,7 @@ let options = {
187187
For compatibility with an existing SocketCluster server, set the `protocolVersion` to `1` and make sure that the `path` matches your old server path:
188188

189189
```js
190-
let socket = asyngularClient.create({
190+
let socket = socketClusterClient.create({
191191
protocolVersion: 1,
192192
path: '/socketcluster/'
193193
});
@@ -198,7 +198,7 @@ let socket = asyngularClient.create({
198198
### Install all dependencies
199199

200200
```bash
201-
cd asyngular-client
201+
cd socketcluster-client
202202

203203
npm install -g gulp gulp-cli browserify uglify-es
204204

@@ -207,21 +207,21 @@ npm install
207207

208208
### Building
209209

210-
To build the Asyngular client:
210+
To build the SocketCluster client:
211211

212212
```bash
213213
npm run build
214214
```
215215

216216
## Change log
217217

218-
See the 'releases' section for changes: https://github.com/SocketCluster/asyngular-client/releases
218+
See the 'releases' section for changes: https://github.com/SocketCluster/socketcluster-client/releases
219219

220220
## License
221221

222222
(The MIT License)
223223

224-
Copyright (c) 2013-2019 Asyngular.io
224+
Copyright (c) 2013-2019 SocketCluster.io
225225

226226
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:
227227

asyngular-client.min.js

-4
This file was deleted.

browserify-build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
SDK_VERSION=$(cat package.json | sed -n -e '/version/ s/.*: *"\([^"]*\).*/\1/p')
44
echo "Building JavaScript SDK v$SDK_VERSION...\n"
5-
browserify -s asyngular index.js > asyngular-client.js && uglifyjs asyngular-client.js -o asyngular-client.min.js
5+
browserify -s socketcluster index.js > socketcluster-client.js && uglifyjs socketcluster-client.js -o socketcluster-client.min.js

gulp-build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
SDK_VERSION=$(cat package.json | sed -n -e '/version/ s/.*: *"\([^"]*\).*/\1/p')
44
echo "Building JavaScript SDK v$SDK_VERSION...\n"
55
echo "Cleaning up old builds...\n"
6-
rm -rf asyngular-client.js asyngular-client.min.js
6+
rm -rf socketcluster-client.js socketcluster-client.min.js
77
echo "Browser Release:"
88
gulp browserify
99
gulp minify

gulpfile.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ var VERSION = require('./package.json').version;
1818
// declaration added by browserify.
1919
var FULL_HEADER = (
2020
'/**\n' +
21-
' * Asyngular JavaScript client v' + VERSION + '\n' +
21+
' * SocketCluster JavaScript client v' + VERSION + '\n' +
2222
' */\n '
2323
);
2424

2525
gulp.task('browserify', function (done) {
2626
var stream = browserify({
2727
builtins: ['_process', 'events', 'buffer', 'querystring'],
2828
entries: 'index.js',
29-
standalone: 'asyngularClient'
29+
standalone: 'socketClusterClient'
3030
})
3131
.ignore('_process')
3232
.require('./index.js', {
33-
expose: 'asyngular-client'
33+
expose: 'socketcluster-client'
3434
})
3535
.bundle();
36-
return stream.pipe(source('asyngular-client.js'))
36+
return stream.pipe(source('socketcluster-client.js'))
3737
.pipe(insert.prepend(FULL_HEADER))
3838
.pipe(convertNewline({
3939
newline: 'lf',
@@ -43,7 +43,7 @@ gulp.task('browserify', function (done) {
4343
});
4444

4545
gulp.task('minify', function () {
46-
return gulp.src(DIST + 'asyngular-client.js')
46+
return gulp.src(DIST + 'socketcluster-client.js')
4747
.pipe(babel({
4848
comments: false
4949
}))

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const AGClientSocket = require('./lib/clientsocket');
22
const factory = require('./lib/factory');
3-
const version = '6.2.4';
3+
const version = '15.0.0';
44

55
module.exports.factory = factory;
66
module.exports.AGClientSocket = AGClientSocket;

lib/clientsocket.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function AGClientSocket(socketOptions) {
2424
AsyncStreamEmitter.call(this);
2525

2626
let defaultOptions = {
27-
path: '/asyngular/',
27+
path: '/socketcluster/',
2828
secure: false,
2929
autoConnect: true,
3030
autoReconnect: true,
@@ -33,7 +33,7 @@ function AGClientSocket(socketOptions) {
3333
ackTimeout: 10000,
3434
timestampRequests: false,
3535
timestampParam: 't',
36-
authTokenName: 'asyngular.authToken',
36+
authTokenName: 'socketcluster.authToken',
3737
binaryType: 'arraybuffer',
3838
batchOnHandshake: false,
3939
batchOnHandshakeDuration: 100,
@@ -148,7 +148,7 @@ function AGClientSocket(socketOptions) {
148148

149149
if (this.options.protocol) {
150150
let protocolOptionError = new InvalidArgumentsError(
151-
'The "protocol" option does not affect asyngular-client - ' +
151+
'The "protocol" option does not affect socketcluster-client - ' +
152152
'If you want to utilize SSL/TLS, use "secure" option instead'
153153
);
154154
this._onError(protocolOptionError);

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "asyngular-client",
3-
"description": "Asyngular JavaScript client",
4-
"version": "6.2.4",
5-
"homepage": "https://asyngular.io/",
2+
"name": "socketcluster-client",
3+
"description": "SocketCluster JavaScript client",
4+
"version": "15.0.0",
5+
"homepage": "https://socketcluster.io/",
66
"contributors": [
77
{
88
"name": "Jonathan Gros-Dubois",
@@ -11,7 +11,7 @@
1111
],
1212
"repository": {
1313
"type": "git",
14-
"url": "git://github.com/SocketCluster/asyngular-client.git"
14+
"url": "git://github.com/SocketCluster/socketcluster-client.git"
1515
},
1616
"scripts": {
1717
"build": "gulp browserify; gulp minify",
@@ -39,7 +39,7 @@
3939
"devDependencies": {
4040
"@babel/core": "^7.7.4",
4141
"@babel/preset-env": "^7.7.4",
42-
"asyngular-server": "^6.2.0",
42+
"socketcluster-server": "^15.0.0",
4343
"babel-plugin-minify-dead-code-elimination": "^0.5.0",
4444
"browserify": "^16.2.3",
4545
"es-check": "^5.1.0",

asyngular-client.js renamed to socketcluster-client.js

+34-23
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* Asyngular JavaScript client v6.2.4
2+
* SocketCluster JavaScript client v15.0.0
33
*/
4-
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.asyngularClient = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
4+
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.socketClusterClient = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
55
(function (global){
66
function AuthEngine() {
77
this._internalStorage = {};
@@ -88,7 +88,7 @@ function AGClientSocket(socketOptions) {
8888
AsyncStreamEmitter.call(this);
8989

9090
let defaultOptions = {
91-
path: '/asyngular/',
91+
path: '/socketcluster/',
9292
secure: false,
9393
autoConnect: true,
9494
autoReconnect: true,
@@ -97,7 +97,7 @@ function AGClientSocket(socketOptions) {
9797
ackTimeout: 10000,
9898
timestampRequests: false,
9999
timestampParam: 't',
100-
authTokenName: 'asyngular.authToken',
100+
authTokenName: 'socketcluster.authToken',
101101
binaryType: 'arraybuffer',
102102
batchOnHandshake: false,
103103
batchOnHandshakeDuration: 100,
@@ -212,7 +212,7 @@ function AGClientSocket(socketOptions) {
212212

213213
if (this.options.protocol) {
214214
let protocolOptionError = new InvalidArgumentsError(
215-
'The "protocol" option does not affect asyngular-client - ' +
215+
'The "protocol" option does not affect socketcluster-client - ' +
216216
'If you want to utilize SSL/TLS, use "secure" option instead'
217217
);
218218
this._onError(protocolOptionError);
@@ -3648,7 +3648,7 @@ function hexSlice (buf, start, end) {
36483648

36493649
var out = ''
36503650
for (var i = start; i < end; ++i) {
3651-
out += toHex(buf[i])
3651+
out += hexSliceLookupTable[buf[i]]
36523652
}
36533653
return out
36543654
}
@@ -4234,11 +4234,6 @@ function base64clean (str) {
42344234
return str
42354235
}
42364236

4237-
function toHex (n) {
4238-
if (n < 16) return '0' + n.toString(16)
4239-
return n.toString(16)
4240-
}
4241-
42424237
function utf8ToBytes (string, units) {
42434238
units = units || Infinity
42444239
var codePoint
@@ -4369,6 +4364,20 @@ function numberIsNaN (obj) {
43694364
return obj !== obj // eslint-disable-line no-self-compare
43704365
}
43714366

4367+
// Create lookup table for `toString('hex')`
4368+
// See: https://github.com/feross/buffer/issues/219
4369+
var hexSliceLookupTable = (function () {
4370+
var alphabet = '0123456789abcdef'
4371+
var table = new Array(256)
4372+
for (var i = 0; i < 16; ++i) {
4373+
var i16 = i * 16
4374+
for (var j = 0; j < 16; ++j) {
4375+
table[i16 + j] = alphabet[i] + alphabet[j]
4376+
}
4377+
}
4378+
return table
4379+
})()
4380+
43724381
}).call(this,require("buffer").Buffer)
43734382
},{"base64-js":10,"buffer":11,"ieee754":13}],12:[function(require,module,exports){
43744383
class ConsumableStream {
@@ -7570,14 +7579,16 @@ function bytesToUuid(buf, offset) {
75707579
var i = offset || 0;
75717580
var bth = byteToHex;
75727581
// join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
7573-
return ([bth[buf[i++]], bth[buf[i++]],
7574-
bth[buf[i++]], bth[buf[i++]], '-',
7575-
bth[buf[i++]], bth[buf[i++]], '-',
7576-
bth[buf[i++]], bth[buf[i++]], '-',
7577-
bth[buf[i++]], bth[buf[i++]], '-',
7578-
bth[buf[i++]], bth[buf[i++]],
7579-
bth[buf[i++]], bth[buf[i++]],
7580-
bth[buf[i++]], bth[buf[i++]]]).join('');
7582+
return ([
7583+
bth[buf[i++]], bth[buf[i++]],
7584+
bth[buf[i++]], bth[buf[i++]], '-',
7585+
bth[buf[i++]], bth[buf[i++]], '-',
7586+
bth[buf[i++]], bth[buf[i++]], '-',
7587+
bth[buf[i++]], bth[buf[i++]], '-',
7588+
bth[buf[i++]], bth[buf[i++]],
7589+
bth[buf[i++]], bth[buf[i++]],
7590+
bth[buf[i++]], bth[buf[i++]]
7591+
]).join('');
75817592
}
75827593

75837594
module.exports = bytesToUuid;
@@ -7634,7 +7645,7 @@ var _clockseq;
76347645
var _lastMSecs = 0;
76357646
var _lastNSecs = 0;
76367647

7637-
// See https://github.com/broofa/node-uuid for API details
7648+
// See https://github.com/uuidjs/uuid for API details
76387649
function v1(options, buf, offset) {
76397650
var i = buf && offset || 0;
76407651
var b = buf || [];
@@ -8045,10 +8056,10 @@ class WritableConsumableStream extends ConsumableStream {
80458056

80468057
module.exports = WritableConsumableStream;
80478058

8048-
},{"./consumer":30,"consumable-stream":12}],"asyngular-client":[function(require,module,exports){
8059+
},{"./consumer":30,"consumable-stream":12}],"socketcluster-client":[function(require,module,exports){
80498060
const AGClientSocket = require('./lib/clientsocket');
80508061
const factory = require('./lib/factory');
8051-
const version = '6.2.4';
8062+
const version = '15.0.0';
80528063

80538064
module.exports.factory = factory;
80548065
module.exports.AGClientSocket = AGClientSocket;
@@ -8059,5 +8070,5 @@ module.exports.create = function (options) {
80598070

80608071
module.exports.version = version;
80618072

8062-
},{"./lib/clientsocket":2,"./lib/factory":3}]},{},["asyngular-client"])("asyngular-client")
8073+
},{"./lib/clientsocket":2,"./lib/factory":3}]},{},["socketcluster-client"])("socketcluster-client")
80638074
});

socketcluster-client.min.js

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)