Skip to content

Commit

Permalink
meta: upgrade to ava 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnyp committed Oct 7, 2018
1 parent 06f817f commit 00ea0b2
Show file tree
Hide file tree
Showing 48 changed files with 807 additions and 1,594 deletions.
18 changes: 0 additions & 18 deletions .babelrc

This file was deleted.

1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules/
**/dist/*.js
bundle.js
packages/xmpp.js/index.js
ava.config.js
2 changes: 1 addition & 1 deletion .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:

parserOptions:
sourceType: script
ecmaVersion: 2017
ecmaVersion: 2018

rules:
strict: [error, global]
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ dist: trusty
language: node_js

node_js:
- '9'
- '10'

cache:
Expand Down
29 changes: 29 additions & 0 deletions ava.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
'use strict'

export default {
babel: {
testOptions: {
plugins: [
[
'@babel/plugin-transform-react-jsx',
{
pragma: 'xml',
},
],
[
'babel-plugin-jsx-pragmatic',
{
module: '@xmpp/xml',
import: 'xml',
},
],
],
},
},
files: [
'packages/**/test.js',
'packages/**/test/*.js',
'packages/**/*.test.js',
'!packages/test/*.js',
],
}
23 changes: 6 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"private": true,
"devDependencies": {
"ava": "^0.25.0",
"babel-cli": "^6.26.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
"ava": "^1.0.0-beta.8",
"babel-plugin-jsx-pragmatic": "^1.0.2",
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-preset-es2015": "^6.22.0",
"babel-register": "^6.26.0",
"browser-pack-flat": "^3.2.0",
"browserify": "^16.2.2",
"bundlesize": "^0.17.0",
Expand All @@ -27,26 +24,18 @@
"sinon": "^6.3.3",
"uglify-es": "^3.3.9"
},
"ava": {
"require": "babel-register",
"babel": "inherit",
"files": [
"packages/**/test.js",
"packages/**/test/*.js",
"packages/**/*.test.js",
"!packages/test/*.js"
]
},
"scripts": {
"bootstrap": "lerna bootstrap",
"test": "ava",
"lint": "eslint ."
},
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
},
"workspaces": ["packages/*"],
"workspaces": [
"packages/*"
],
"bundlesize": [
{
"path": "./packages/client/dist/xmpp.min.js.gz",
Expand Down
2 changes: 1 addition & 1 deletion packages/client-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@xmpp/xml": "^0.3.0"
},
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
11 changes: 6 additions & 5 deletions packages/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ function getDomain(service) {
}

function client(options = {}) {
const {resource, username, password, domain, service} = options
const {resource, credentials, username, password, ...params} = options

const {domain, service} = params
if (!domain && service) {
options.domain = getDomain(service)
params.domain = getDomain(service)
}
const credentials = options.credentials || {username, password}

const entity = new Client(options)
const entity = new Client(params)

const reconnect = _reconnect({entity})
const websocket = _websocket({entity})
Expand All @@ -56,7 +57,7 @@ function client(options = {}) {
// Stream features - order matters and define priority
const starttls =
typeof _starttls === 'function' ? _starttls({streamFeatures}) : undefined
const sasl = _sasl({streamFeatures}, credentials)
const sasl = _sasl({streamFeatures}, credentials || {username, password})
const resourceBinding = _resourceBinding({iqCaller, streamFeatures}, resource)
const sessionEstablishment = _sessionEstablishment({iqCaller, streamFeatures})
// SASL mechanisms - order matters and define priority
Expand Down
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"../../node_modules/uglify-es/bin/uglifyjs dist/xmpp.js -c -m --source-map url=xmpp.min.js.map,content=dist/xmpp.js.map -o dist/xmpp.min.js"
},
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/component-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@xmpp/xml": "^0.3.0"
},
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@xmpp/reconnect": "^0.3.0"
},
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/connection-tcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@xmpp/xml": "^0.3.0"
},
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/connection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@xmpp/xml": "^0.3.0"
},
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/debug/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Prints to the console debug information for an entity.

## Install

`npm install @xmpp/component` or `yarn add @xmpp/component`
`npm install @xmpp/debug` or `yarn add @xmpp/debug`

## Example

Expand Down
2 changes: 1 addition & 1 deletion packages/debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"license": "ISC",
"keywords": ["XMPP", "debug"],
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/entity-capabilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@xmpp/xml": "^0.3.0"
},
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"EventEmitter"
],
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/id/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"license": "ISC",
"keywords": ["XMPP", "id"],
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/iq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"callee"
],
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/jid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"license": "ISC",
"keywords": ["XMPP", "JID"],
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
12 changes: 0 additions & 12 deletions packages/jid/test/escaping.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ test('escape `space\\20cadet@example.com`', t => {
t.is(esc.toString(true), 'space cadet@example.com')
})

test('escape `call me "ishmael"@example.com`', t => {
const esc = new JID('call me "ishmael"', 'example.com')
t.is(esc.toString(), 'call\\20me\\20\\22ishmael\\22@example.com')
t.is(esc.toString(true), 'call me "ishmael"@example.com')
})

test('escape `at\\26t\\20guy@example.com`', t => {
const esc = new JID('at\\26t\\20guy', 'example.com')
t.is(esc.toString(), 'at\\26t\\20guy@example.com')
Expand Down Expand Up @@ -129,12 +123,6 @@ test('escape `c\\3a\\5cnet@example.com`', t => {
t.is(esc.toString(true), 'c:\\net@example.com')
})

test('escape `c:\\\\net@example.com`', t => {
const esc = new JID('c:\\\\net', 'example.com')
t.is(esc.toString(), 'c\\3a\\5c\\5cnet@example.com')
t.is(esc.toString(true), 'c:\\\\net@example.com')
})

test('escape `c\\3a\\5ccool\\20stuff@example.com`', t => {
const esc = new JID('c\\3a\\5ccool\\20stuff', 'example.com')
t.is(esc.toString(), 'c\\3a\\5ccool\\20stuff@example.com')
Expand Down
2 changes: 1 addition & 1 deletion packages/middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"koa-compose": "^4.1.0"
},
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/ping/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"ping"
],
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/pubsub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"subscribe"
],
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/reconnect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "ISC",
"keywords": ["XMPP", "reconnect"],
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/resolve/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"node-fetch": "^2.2.0"
},
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/resource-binding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@xmpp/xml": "^0.3.0"
},
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/roster/consumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class RosterConsumer extends EventEmitter {
xml(
'query',
{xmlns: NS},
xml('item', item, groups.map(g => <group>{g}</group>))
xml('item', item, groups.map(g => xml('group', {}, g)))
),
...args
)
Expand Down
2 changes: 1 addition & 1 deletion packages/roster/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"roster"
],
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/sasl-anonymous/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"sasl-anonymous": "^0.1.0"
},
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/sasl-plain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"sasl-plain": "^0.1.0"
},
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/sasl-scram-sha-1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"sasl-scram-sha-1": "^1.2.0"
},
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/sasl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"buffer": false
},
"engines": {
"node": ">= 9.6.1",
"node": ">= 10.0.0",
"yarn": ">= 1.0.0"
}
}
Loading

0 comments on commit 00ea0b2

Please sign in to comment.