Skip to content

Commit

Permalink
make workerChannel a completely separate npm module
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillan committed May 20, 2024
1 parent 8f46779 commit 53025e7
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 15 deletions.
2 changes: 1 addition & 1 deletion node/src/Channel.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as os from 'node:os';
import { info, warn } from 'node:console';
import * as flatbuffers from 'flatbuffers';
import { WorkerChannel } from '../workerChannel';
import { WorkerChannel } from 'worker-channel';
import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import { InvalidStateError } from './errors';
Expand Down
2 changes: 1 addition & 1 deletion node/src/Worker.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as process from 'node:process';
import * as path from 'node:path';
import { WorkerChannel } from 'worker-channel';
import { version } from './';
import { WorkerChannel } from '../workerChannel';
import { Logger } from './Logger';
import { EnhancedEventEmitter } from './enhancedEvents';
import * as ortc from './ortc';
Expand Down
30 changes: 26 additions & 4 deletions node/workerChannel/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions node/workerChannel/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mediasoup worker channel",
"version": "0.0.0",
"name": "worker-channel",
"version": "1.0.0",
"description": "Node.js Addon to communicate with mediasoup worker",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand All @@ -13,6 +13,7 @@
"test": "node npm-scripts.mjs test"
},
"dependencies": {
"debug": "^4.3.4",
"node-addon-api": "*"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions node/workerChannel/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventEmitter } from 'events';
import { EnhancedEventEmitter } from '../../src/enhancedEvents';
import { EnhancedEventEmitter } from './enhancedEvents';

const buildType = process.env.MEDIASOUP_BUILDTYPE ?? 'Release';

Expand All @@ -9,7 +9,7 @@ const { WorkerChannel: NativeWorkerChannel } = require(
);

export type WorkerChannelEvents = {
data: [Uint8Array];
data: [Buffer];
error: [number];
};

Expand Down
31 changes: 27 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@
"ini": "^4.1.2",
"node-fetch": "^3.3.2",
"supports-color": "^9.4.0",
"tar": "^7.1.0"
"tar": "^7.1.0",
"worker-channel": "file:node/workerChannel"
},
"devDependencies": {
"@octokit/rest": "^20.1.1",
Expand Down

0 comments on commit 53025e7

Please sign in to comment.