Skip to content

Commit ab2b57d

Browse files
committed
Various tweaks:
* Make options.port a number, after parsing the url * Update some package.json dependencies (bar `ws`, left at 1.x) * Make travis `script` execute `npm run ci` to send codecov results * Add an .editorconfig file * Add nodejs 4.3.2 to the build matrix for AWS Lambda * Add C++11 compatible compiler for extensions
1 parent b645b80 commit ab2b57d

File tree

5 files changed

+51
-23
lines changed

5 files changed

+51
-23
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2
9+
trim_trailing_whitespace = true

.travis.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,23 @@ language: node_js
22
sudo: false
33
node_js:
44
- '4'
5+
# AWS Lambda
6+
- '4.3.2'
57
- '6'
68
- '7'
9+
env:
10+
# For compiling optional extensions
11+
addons:
12+
apt:
13+
sources:
14+
- ubuntu-toolchain-r-test
15+
packages:
16+
- g++-4.8
717
env:
818
global:
919
- secure: ODwb1nuf12e0Ja/HgPwZh4aU01G8tTYZliSHI7ZWmYzGv3Yde6UnATeFG8sxGnWPRXTmaZelZfzhq7Aco1fEUnPm31af3z/iaV60iNmz6E1ifTR+oX7jxIvCDtHwBrgevrmIH8vrEUm/kQqDnFNrGG8Cc2xw/LjsNUG1wuWD+I4=
1020
- secure: buYrn01nPzsiduIQ5oqYTlBdDtM9WKP6gqoyq7IsutHb9sfwh9I6pUYsLibUo4Fq2um9QeXRZ4h1JLKK9xzDVSBpIGGaVzI4ClenfNt9O20IBGBnXcmEKPiRNYF4DkrqZzgx/OVWa6xzcRQI2R1ASQfoyfdpPAnqWXbfalSNkzs=
1121
- secure: IJRxzV03o76uiL4tCw/Zk0Es6tS/ATlQNIpQxZOyRLBoGTmZfZRKRxiESCKUASHudJgNIlw0kar2/LSJjMlYC4KnlrMJOLCYakXW+CWySe4q/f+qbrcdSK1+DZpjyr6Rmo654td/DD5KjNF3UgwBbi1GkE5fd4UL9HI5mPqDpqw=
22+
- CXX=g++-4.8
23+
script:
24+
- npm run ci

lib/connect/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,13 @@ function connect (brokerUrl, opts) {
4949
opts = opts || {}
5050

5151
if (brokerUrl) {
52-
opts = xtend(url.parse(brokerUrl, true), opts)
52+
var parsed = url.parse(brokerUrl, true)
53+
if (parsed.port != null) {
54+
parsed.port = Number(parsed.port)
55+
}
56+
57+
opts = xtend(parsed, opts)
58+
5359
if (opts.protocol === null) {
5460
throw new Error('Missing protocol')
5561
}

package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"browser-build": "rimraf dist/ && mkdirp dist/ && browserify mqtt.js -s mqtt > dist/mqtt.js && uglifyjs --screw-ie8 < dist/mqtt.js > dist/mqtt.min.js",
2626
"browser-test": "zuul --server test/browser/server.js --local --open test/browser/test.js",
2727
"sauce-test": "zuul --server test/browser/server.js --tunnel ngrok -- test/browser/test.js",
28-
"ci": "npm runt test && codecov"
28+
"ci": "npm run test && codecov"
2929
},
3030
"pre-commit": [
3131
"test"
@@ -56,38 +56,38 @@
5656
},
5757
"dependencies": {
5858
"commist": "^1.0.0",
59-
"concat-stream": "^1.4.7",
59+
"concat-stream": "^1.6.0",
6060
"end-of-stream": "^1.1.0",
61-
"help-me": "^1.0.0",
62-
"inherits": "^2.0.1",
63-
"minimist": "^1.1.0",
64-
"mqtt-packet": "^5.0.0",
65-
"readable-stream": "^2.1.0",
66-
"pump": "^1.0.1",
67-
"reinterval": "^1.0.1",
68-
"split2": "^2.0.1",
69-
"websocket-stream": "^3.3.2",
70-
"xtend": "^4.0.0"
61+
"help-me": "^1.0.1",
62+
"inherits": "^2.0.3",
63+
"minimist": "^1.2.0",
64+
"mqtt-packet": "^5.2.1",
65+
"readable-stream": "^2.2.3",
66+
"pump": "^1.0.2",
67+
"reinterval": "^1.1.0",
68+
"split2": "^2.1.1",
69+
"websocket-stream": "^3.3.3",
70+
"xtend": "^4.0.1"
7171
},
7272
"devDependencies": {
73-
"browserify": "^14.0.0",
73+
"browserify": "^14.1.0",
7474
"codecov": "^1.0.1",
7575
"istanbul": "^0.4.5",
7676
"mkdirp": "^0.5.1",
7777
"mocha": "^3.2.0",
7878
"mqtt-connection": "^3.0.0",
7979
"nsp": "^2.6.2",
80-
"pre-commit": "^1.1.3",
81-
"rimraf": "^2.5.4",
80+
"pre-commit": "^1.2.2",
81+
"rimraf": "^2.6.1",
8282
"should": "*",
83-
"sinon": "~1.17.0",
83+
"sinon": "~1.17.7",
8484
"snazzy": "^6.0.0",
85-
"standard": "^8.0.0",
86-
"through2": "^2.0.0",
87-
"uglify": "^0.1.1",
88-
"uglify-js": "^2.7.4",
85+
"standard": "^8.6.0",
86+
"through2": "^2.0.3",
87+
"uglify": "^0.1.5",
88+
"uglify-js": "^2.7.5",
8989
"ws": "^1.0.0",
90-
"zuul": "^3.4.0",
90+
"zuul": "^3.11.1",
9191
"zuul-ngrok": "^4.0.0"
9292
},
9393
"standard": {

test/mqtt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('mqtt', function () {
5757
var c = mqtt.connect('tcp://user:pass@localhost:1883')
5858

5959
c.options.should.have.property('hostname', 'localhost')
60-
c.options.should.have.property('port', '1883')
60+
c.options.should.have.property('port', 1883)
6161
})
6262

6363
sslOpts = {

0 commit comments

Comments
 (0)