Skip to content

Commit

Permalink
node-datachannel@0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yandeu committed May 7, 2024
1 parent 97fbb89 commit f03d5b6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
"build:client": "tsc --build packages/client/tsconfig.json",
"build:server": "tsc --build packages/server/tsconfig.json",
"build:cjs": "tsc --build packages/common/tsconfig.cjs.json && node ./scripts/changeImports.mjs && tsc --build packages/server/tsconfig.cjs.json && node ./scripts/changeImports.mjs --reverse && node ./scripts/packageType.mjs",
"build": "npm run clear && npm run build:common && npm run build:client && npm run build:server && npm run build:cjs",
"build": "npm run clear && npm run build:common && npm run build:client && npm run build:server",
"publish": "npm-run-all build publish:*",
"publish:common": "cd packages/common/ && npm publish",
"publish:server": "cd packages/server/ && npm publish",
"publish:client": "cd packages/client/ && npm publish",
"dev": "npm run build && cd packages/chatApp && npm run dev",
"postinstall": "lerna bootstrap --no-ci && npm run build",
"test": "npm run build-client-bundle && npm run test:mjs && npm run test:cjs",
"test": "npm run build-client-bundle && npm run test:mjs",
"test:mjs": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage --forceExit --testMatch \"**/test/{common,e2e,server}/**/*test.?(c)js\"",
"test:cjs": "jest --coverage --forceExit --testMatch \"**/test/cjs/**/*test.?(c)js\"",
"clear": "rimraf packages/client/lib packages/common/lib packages/server/lib packages/common/cjs packages/server/cjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"dependencies": {
"@geckos.io/common": "^3.0.0",
"@yandeu/events": "0.0.6",
"node-datachannel": "0.7.0"
"node-datachannel": "0.8.0"
},
"funding": {
"url": "https://github.com/sponsors/yandeu"
Expand Down
8 changes: 4 additions & 4 deletions packages/server/src/wrtc/nodeDataChannel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable sort-imports */
import ndc from 'node-datachannel'
import type { DataChannel, DataChannelInitConfig, PeerConnection, RtcConfig } from 'node-datachannel'
import { PeerConnection, cleanup as ndc_cleanup } from 'node-datachannel'
import type { DataChannel, DataChannelInitConfig, RtcConfig } from 'node-datachannel'
export type { DataChannel, DataChannelInitConfig, PeerConnection, RtcConfig }

export const wait = (ms: number = 1000): Promise<void> => {
Expand Down Expand Up @@ -30,7 +30,7 @@ export const createDataChannel = (
export const createPeerConnection = (peerName: string, config: RtcConfig): Promise<PeerConnection> => {
return new Promise((resolve, reject) => {
try {
const peerConnection = new ndc.PeerConnection(peerName, config)
const peerConnection = new PeerConnection(peerName, config)
resolve(peerConnection)
} catch (err) {
reject(err)
Expand Down Expand Up @@ -63,7 +63,7 @@ export const closeDataChannel = (dataChannel: DataChannel): Promise<void> => {
export const cleanup = (): Promise<void> => {
return new Promise(resolve => {
try {
ndc.cleanup()
ndc_cleanup()
resolve()
} catch (err) {
resolve()
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"target": "ES2019",
"module": "es2020",
"moduleResolution": "node",
"module": "Node16",
"moduleResolution": "Node16",

"sourceMap": true,
"declaration": true,
Expand Down

0 comments on commit f03d5b6

Please sign in to comment.