Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps(dev): bump aegir from 38.1.8 to 40.0.0 #74

Merged
merged 2 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
]
},
"scripts": {
"clean": "aegir clean",
"lint": "aegir lint",
"dep-check": "aegir dep-check",
"build": "aegir build",
Expand All @@ -188,7 +189,7 @@
},
"devDependencies": {
"@types/ws": "^8.2.2",
"aegir": "^38.1.8",
"aegir": "^40.0.0",
"delay": "^5.0.0",
"it-all": "^3.0.1",
"it-drain": "^3.0.1",
Expand Down
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// load websocket library if we are not in the browser
import WebSocket from './web-socket.js'
import duplex from './duplex.js'
import WebSocket from './web-socket.js'
import wsurl from './ws-url.js'
import type { ClientOptions } from 'ws'
import type { DuplexWebSocket } from './duplex.js'
import type { SinkOptions } from './sink.js'
import type { ClientOptions } from 'ws'

export interface WebSocketOptions extends SinkOptions {
websocket?: ClientOptions
Expand Down
4 changes: 2 additions & 2 deletions src/duplex.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import source from './source.js'
import sink from './sink.js'
import type WebSocket from './web-socket.js'
import source from './source.js'
import type { SinkOptions } from './sink.js'
import type WebSocket from './web-socket.js'
import type { Duplex, Source } from 'it-stream-types'

export interface DuplexWebSocket extends Duplex<AsyncGenerator<Uint8Array>, Source<Uint8Array>, Promise<void>> {
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

export { default as duplex } from './duplex.js'
export { default as source } from './source.js'
export { default as sink } from './sink.js'
Expand Down
10 changes: 5 additions & 5 deletions src/server.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import duplex, { DuplexWebSocket } from './duplex.js'
import { WebSocketServer as WSServer } from 'ws'
import { EventEmitter } from 'events'
import http from 'http'
import https from 'https'
import { EventEmitter } from 'events'
import type { VerifyClientCallbackSync, VerifyClientCallbackAsync, AddressInfo } from 'ws'
import { WebSocketServer as WSServer } from 'ws'
import duplex, { type DuplexWebSocket } from './duplex.js'
import type WebSocket from './web-socket.js'
import type { VerifyClientCallbackSync, VerifyClientCallbackAsync, AddressInfo } from 'ws'

export interface ServerOptions {
key?: string
Expand Down Expand Up @@ -37,7 +37,7 @@ class Server extends EventEmitter {
}

async listen (addrInfo: { port: number } | number): Promise<WebSocketServer> {
return await new Promise<WebSocketServer>((resolve, reject) => {
return new Promise<WebSocketServer>((resolve, reject) => {
this.wsServer.once('error', (e) => { reject(e) })
this.wsServer.once('listening', () => { resolve(this) })
this.server.listen(typeof addrInfo === 'number' ? addrInfo : addrInfo.port)
Expand Down
2 changes: 1 addition & 1 deletion src/sink.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ready from './ready.js'
import type { WebSocket } from 'ws'
import type { Sink, Source } from 'it-stream-types'
import type { WebSocket } from 'ws'

export interface SinkOptions {
closeOnEnd?: boolean
Expand Down
1 change: 0 additions & 1 deletion src/source.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { EventIterator } from 'event-iterator'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import type { WebSocket, ErrorEvent, MessageEvent } from 'ws'
Expand Down
8 changes: 4 additions & 4 deletions test/close-on-end.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { expect } from 'aegir/chai'
import WebSocket from '../src/web-socket.js'
import drain from 'it-drain'
import { pipe } from 'it-pipe'
import each from 'it-foreach'
import wsurl from './helpers/wsurl.js'
import * as WS from '../src/index.js'
import { pipe } from 'it-pipe'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import * as WS from '../src/index.js'
import WebSocket from '../src/web-socket.js'
import wsurl from './helpers/wsurl.js'

const endpoint = wsurl + '/echo'

Expand Down
8 changes: 4 additions & 4 deletions test/duplex.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { expect } from 'aegir/chai'
import WebSocket from '../src/web-socket.js'
import delay from 'delay'
import drain from 'it-drain'
import { pipe } from 'it-pipe'
import wsurl from './helpers/wsurl.js'
import * as WS from '../src/index.js'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import delay from 'delay'
import * as WS from '../src/index.js'
import WebSocket from '../src/web-socket.js'
import wsurl from './helpers/wsurl.js'

const endpoint = wsurl + '/echo'

Expand Down
8 changes: 4 additions & 4 deletions test/echo-inline.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { expect } from 'aegir/chai'
import * as WS from '../src/index.js'
import * as ndjson from 'it-ndjson'
import map from 'it-map'
import all from 'it-all'
import map from 'it-map'
import * as ndjson from 'it-ndjson'
import { pipe } from 'it-pipe'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import { isNode, isElectronMain } from 'wherearewe'
import * as WS from '../src/index.js'

describe('simple echo server', () => {
if (!(isNode || isElectronMain)) {
Expand All @@ -23,7 +23,7 @@ describe('simple echo server', () => {
[1, 2, 3],
// need a delay, because otherwise ws hangs up wrong.
// otherwise use pull-goodbye.
(source) => map(source, async val => await new Promise(resolve => setTimeout(() => { resolve(val) }, 10))),
(source) => map(source, async val => new Promise(resolve => setTimeout(() => { resolve(val) }, 10))),
(source) => map(ndjson.stringify(source), str => uint8ArrayFromString(str)),
WS.connect('ws://localhost:5678'),
ndjson.parse,
Expand Down
12 changes: 6 additions & 6 deletions test/echo.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { expect } from 'aegir/chai'
import WebSocket from '../src/web-socket.js'
import * as WS from '../src/index.js'
import { pipe } from 'it-pipe'
import { goodbye } from 'it-goodbye'
import wsurl from './helpers/wsurl.js'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import drain from 'it-drain'
import each from 'it-foreach'
import { goodbye } from 'it-goodbye'
import { pipe } from 'it-pipe'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import * as WS from '../src/index.js'
import WebSocket from '../src/web-socket.js'
import wsurl from './helpers/wsurl.js'

const endpoint = wsurl + '/echo'

Expand Down
6 changes: 3 additions & 3 deletions test/error.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { expect } from 'aegir/chai'
import WebSocket from '../src/web-socket.js'
import drain from 'it-drain'
import { pipe } from 'it-pipe'
import defer from 'p-defer'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import * as WS from '../src/index.js'
import drain from 'it-drain'
import defer from 'p-defer'
import WebSocket from '../src/web-socket.js'

describe('error', () => {
// connect to a server that does not exist, and check that it errors.
Expand Down
4 changes: 2 additions & 2 deletions test/load.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { pipe } from 'it-pipe'
import each from 'it-foreach'
import drain from 'it-drain'
import each from 'it-foreach'
import { pipe } from 'it-pipe'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import { isNode, isElectronMain } from 'wherearewe'
import * as WS from '../src/index.js'
Expand Down
10 changes: 5 additions & 5 deletions test/pass-in-server.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import http from 'http'
import { expect } from 'aegir/chai'
import * as WS from '../src/index.js'
import all from 'it-all'
import map from 'it-map'
import * as ndjson from 'it-ndjson'
import { pipe } from 'it-pipe'
import map from 'it-map'
import all from 'it-all'
import http from 'http'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import { isNode, isElectronMain } from 'wherearewe'
import * as WS from '../src/index.js'
import type { WebSocketServer } from '../src/server.js'

describe('simple echo server', () => {
Expand Down Expand Up @@ -40,7 +40,7 @@ describe('simple echo server', () => {
[1, 2, 3],
// need a delay, because otherwise ws hangs up wrong.
// otherwise use pull-goodbye.
(source) => map(source, async val => await new Promise(resolve => setTimeout(() => { resolve(val) }, 10))),
(source) => map(source, async val => new Promise(resolve => setTimeout(() => { resolve(val) }, 10))),
(source) => map(ndjson.stringify(source), str => uint8ArrayFromString(str)),
stream,
ndjson.parse,
Expand Down
10 changes: 5 additions & 5 deletions test/read.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { expect } from 'aegir/chai'
import WebSocket from '../src/web-socket.js'
import { pipe } from 'it-pipe'
import all from 'it-all'
import { pipe } from 'it-pipe'
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
import * as WS from '../src/index.js'
import WebSocket from '../src/web-socket.js'
import wsurl from './helpers/wsurl.js'
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'

const endpoint = wsurl + '/read'

Expand All @@ -22,7 +22,7 @@ describe('read', () => {
it('read values from the socket and end normally', async function () {
const values = await pipe(
WS.duplex(socket),
async (source) => await all(source)
async (source) => all(source)
)

expect(values.map((arr: Uint8Array) => uint8ArrayToString(arr))).to.deep.equal(['a', 'b', 'c', 'd'])
Expand All @@ -31,7 +31,7 @@ describe('read', () => {
it('read values from a new socket and end normally', async function () {
const values = await pipe(
WS.duplex(new WebSocket(endpoint)),
async (source) => await all(source)
async (source) => all(source)
)

expect(values.map((arr: Uint8Array) => uint8ArrayToString(arr))).to.deep.equal(['a', 'b', 'c', 'd'])
Expand Down
10 changes: 5 additions & 5 deletions test/server-echo.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { expect } from 'aegir/chai'
import * as WS from '../src/index.js'
import * as ndjson from 'it-ndjson'
import { pipe } from 'it-pipe'
import map from 'it-map'
import delay from 'delay'
import all from 'it-all'
import each from 'it-foreach'
import delay from 'delay'
import map from 'it-map'
import * as ndjson from 'it-ndjson'
import { pipe } from 'it-pipe'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import { isNode, isElectronMain } from 'wherearewe'
import * as WS from '../src/index.js'

describe('simple echo server', () => {
if (!(isNode || isElectronMain)) {
Expand Down