mediasoup 3.12.2 → 3.12.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -90,7 +90,7 @@ class Worker extends EnhancedEventEmitter_1.EnhancedEventEmitter {
90
90
  // options
91
91
  {
92
92
  env: {
93
- MEDIASOUP_VERSION: '3.12.2',
93
+ MEDIASOUP_VERSION: '3.12.4',
94
94
  // Let the worker process inherit all environment variables, useful
95
95
  // if a custom and not in the path GCC is used so the user can set
96
96
  // LD_LIBRARY_PATH environment variable for runtime.
@@ -10,7 +10,7 @@ export { types };
10
10
  /**
11
11
  * Expose mediasoup version.
12
12
  */
13
- export declare const version = "3.12.2";
13
+ export declare const version = "3.12.4";
14
14
  /**
15
15
  * Expose parseScalabilityMode() function.
16
16
  */
package/node/lib/index.js CHANGED
@@ -11,7 +11,7 @@ exports.types = types;
11
11
  /**
12
12
  * Expose mediasoup version.
13
13
  */
14
- exports.version = '3.12.2';
14
+ exports.version = '3.12.4';
15
15
  /**
16
16
  * Expose parseScalabilityMode() function.
17
17
  */
@@ -1,9 +1,10 @@
1
- const process = require('process');
2
- const os = require('os');
3
- const fs = require('fs');
4
- const { execSync, spawnSync } = require('child_process');
5
- const fetch = require('node-fetch');
6
- const tar = require('tar');
1
+ import process from 'process';
2
+ import os from 'os';
3
+ import fs from 'fs';
4
+ import path from 'path';
5
+ import { execSync, spawnSync } from 'child_process';
6
+ import fetch from 'node-fetch';
7
+ import tar from 'tar';
7
8
 
8
9
  const PKG = JSON.parse(fs.readFileSync('./package.json').toString());
9
10
  const IS_FREEBSD = os.platform() === 'freebsd';
@@ -73,7 +74,11 @@ async function run()
73
74
  logInfo('skipping mediasoup-worker prebuilt download, building it locally');
74
75
 
75
76
  buildWorker();
76
- cleanWorkerArtifacts();
77
+
78
+ if (!process.env.MEDIASOUP_LOCAL_DEV)
79
+ {
80
+ cleanWorkerArtifacts();
81
+ }
77
82
  }
78
83
  // Attempt to download a prebuilt binary. Fallback to building locally.
79
84
  else if (!(await downloadPrebuiltWorker()))
@@ -98,8 +103,8 @@ async function run()
98
103
 
99
104
  case 'typescript:watch':
100
105
  {
101
- // NOTE: Load dep here since it's a devDependency.
102
- const { TscWatchClient } = require('tsc-watch/client');
106
+ // NOTE: Load dep on demand since it's a devDependency.
107
+ const { TscWatchClient } = await import('tsc-watch/client.js');
103
108
 
104
109
  const watch = new TscWatchClient();
105
110
 
@@ -200,8 +205,8 @@ async function run()
200
205
 
201
206
  try
202
207
  {
203
- octokit = getOctokit();
204
- versionChanges = getVersionChanges();
208
+ octokit = await getOctokit();
209
+ versionChanges = await getVersionChanges();
205
210
  }
206
211
  catch (error)
207
212
  {
@@ -357,7 +362,7 @@ function lintNode()
357
362
  {
358
363
  logInfo('lintNode()');
359
364
 
360
- executeCmd('eslint -c node/.eslintrc.js --max-warnings 0 node/src node/.eslintrc.js npm-scripts.js worker/scripts/gulpfile.js');
365
+ executeCmd('eslint -c node/.eslintrc.js --max-warnings 0 node/src node/.eslintrc.js npm-scripts.mjs worker/scripts/gulpfile.mjs');
361
366
  }
362
367
 
363
368
  function lintWorker()
@@ -547,8 +552,10 @@ async function downloadPrebuiltWorker()
547
552
 
548
553
  try
549
554
  {
555
+ const resolvedBinPath = path.resolve(WORKER_RELEASE_BIN_PATH);
556
+
550
557
  execSync(
551
- `${WORKER_RELEASE_BIN_PATH}`,
558
+ resolvedBinPath,
552
559
  {
553
560
  stdio : [ 'ignore', 'ignore', 'ignore' ],
554
561
  // Ensure no env is passed to avoid accidents.
@@ -599,7 +606,7 @@ async function uploadMacArmPrebuiltWorker()
599
606
  return;
600
607
  }
601
608
 
602
- const octokit = getOctokit();
609
+ const octokit = await getOctokit();
603
610
 
604
611
  logInfo('uploadMacArmPrebuiltWorker() | getting release info');
605
612
 
@@ -623,15 +630,15 @@ async function uploadMacArmPrebuiltWorker()
623
630
  });
624
631
  }
625
632
 
626
- function getOctokit()
633
+ async function getOctokit()
627
634
  {
628
635
  if (!process.env.GITHUB_TOKEN)
629
636
  {
630
637
  throw new Error('missing GITHUB_TOKEN environment variable');
631
638
  }
632
639
 
633
- // NOTE: Load dep here since it's a devDependency.
634
- const { Octokit } = require('@octokit/rest');
640
+ // NOTE: Load dep on demand since it's a devDependency.
641
+ const { Octokit } = await import('@octokit/rest');
635
642
 
636
643
  const octokit = new Octokit(
637
644
  {
@@ -641,12 +648,12 @@ function getOctokit()
641
648
  return octokit;
642
649
  }
643
650
 
644
- function getVersionChanges()
651
+ async function getVersionChanges()
645
652
  {
646
653
  logInfo('getVersionChanges()');
647
654
 
648
- // NOTE: Load dep here since it's a devDependency.
649
- const marked = require('marked');
655
+ // NOTE: Load dep on demand since it's a devDependency.
656
+ const marked = await import('marked');
650
657
 
651
658
  const changelog = fs.readFileSync('./CHANGELOG.md').toString();
652
659
  const entries = marked.lexer(changelog);
@@ -692,19 +699,19 @@ function executeCmd(command, exitOnError = true)
692
699
  function logInfo(message)
693
700
  {
694
701
  // eslint-disable-next-line no-console
695
- console.log(`npm-scripts.js \x1b[36m[INFO] [${task}]\x1b\[0m`, message);
702
+ console.log(`npm-scripts \x1b[36m[INFO] [${task}]\x1b\[0m`, message);
696
703
  }
697
704
 
698
705
  function logWarn(message)
699
706
  {
700
707
  // eslint-disable-next-line no-console
701
- console.warn(`npm-scripts.js \x1b[33m[WARN] [${task}]\x1b\[0m`, message);
708
+ console.warn(`npm-scripts \x1b[33m[WARN] [${task}]\x1b\[0m`, message);
702
709
  }
703
710
 
704
711
  function logError(message)
705
712
  {
706
713
  // eslint-disable-next-line no-console
707
- console.error(`npm-scripts.js \x1b[31m[ERROR] [${task}]\x1b\[0m`, message);
714
+ console.error(`npm-scripts \x1b[31m[ERROR] [${task}]\x1b\[0m`, message);
708
715
  }
709
716
 
710
717
  function exitWithError()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediasoup",
3
- "version": "3.12.2",
3
+ "version": "3.12.4",
4
4
  "description": "Cutting Edge WebRTC Video Conferencing",
5
5
  "contributors": [
6
6
  "Iñaki Baz Castillo <ibc@aliax.net> (https://inakibaz.me)",
@@ -36,7 +36,7 @@
36
36
  "worker/Makefile",
37
37
  "worker/meson.build",
38
38
  "worker/meson_options.txt",
39
- "npm-scripts.js"
39
+ "npm-scripts.mjs"
40
40
  ],
41
41
  "keywords": [
42
42
  "webrtc",
@@ -48,25 +48,25 @@
48
48
  "node": ">=16"
49
49
  },
50
50
  "scripts": {
51
- "prepare": "node npm-scripts.js prepare",
52
- "postinstall": "node npm-scripts.js postinstall",
53
- "typescript:build": "node npm-scripts.js typescript:build",
54
- "typescript:watch": "node npm-scripts.js typescript:watch",
55
- "worker:build": "node npm-scripts.js worker:build",
56
- "worker:prebuild": "node npm-scripts.js worker:prebuild",
51
+ "prepare": "node npm-scripts.mjs prepare",
52
+ "postinstall": "node npm-scripts.mjs postinstall",
53
+ "typescript:build": "node npm-scripts.mjs typescript:build",
54
+ "typescript:watch": "node npm-scripts.mjs typescript:watch",
55
+ "worker:build": "node npm-scripts.mjs worker:build",
56
+ "worker:prebuild": "node npm-scripts.mjs worker:prebuild",
57
57
  "lint": "npm run lint:node && npm run lint:worker",
58
- "lint:node": "node npm-scripts.js lint:node",
59
- "lint:worker": "node npm-scripts.js lint:worker",
60
- "format:worker": "node npm-scripts.js format:worker",
58
+ "lint:node": "node npm-scripts.mjs lint:node",
59
+ "lint:worker": "node npm-scripts.mjs lint:worker",
60
+ "format:worker": "node npm-scripts.mjs format:worker",
61
61
  "test": "npm run test:node && npm run test:worker",
62
- "test:node": "node npm-scripts.js test:node",
63
- "test:worker": "node npm-scripts.js test:worker",
64
- "coverage:node": "node npm-scripts.js coverage:node",
65
- "install-deps:node": "node npm-scripts.js install-deps:node",
66
- "install-clang-tools": "node npm-scripts.js install-clang-tools",
67
- "release:check": "node npm-scripts.js release:check",
68
- "release": "node npm-scripts.js release",
69
- "release:upload-mac-arm-prebuilt-worker": "node npm-scripts.js release:upload-mac-arm-prebuilt-worker"
62
+ "test:node": "node npm-scripts.mjs test:node",
63
+ "test:worker": "node npm-scripts.mjs test:worker",
64
+ "coverage:node": "node npm-scripts.mjs coverage:node",
65
+ "install-deps:node": "node npm-scripts.mjs install-deps:node",
66
+ "install-clang-tools": "node npm-scripts.mjs install-clang-tools",
67
+ "release:check": "node npm-scripts.mjs release:check",
68
+ "release": "node npm-scripts.mjs release",
69
+ "release:upload-mac-arm-prebuilt-worker": "node npm-scripts.mjs release:upload-mac-arm-prebuilt-worker"
70
70
  },
71
71
  "jest": {
72
72
  "verbose": true,
@@ -89,28 +89,28 @@
89
89
  "dependencies": {
90
90
  "debug": "^4.3.4",
91
91
  "h264-profile-level-id": "^1.0.1",
92
- "node-fetch": "^2.6.11",
92
+ "node-fetch": "^3.3.1",
93
93
  "supports-color": "^9.3.1",
94
94
  "tar": "^6.1.15",
95
95
  "uuid": "^9.0.0"
96
96
  },
97
97
  "devDependencies": {
98
- "@octokit/rest": "^19.0.11",
98
+ "@octokit/rest": "^19.0.13",
99
99
  "@types/debug": "^4.1.8",
100
- "@types/jest": "^29.5.1",
101
- "@types/node": "^18.15.11",
102
- "@types/uuid": "^9.0.1",
103
- "@typescript-eslint/eslint-plugin": "^5.59.7",
104
- "@typescript-eslint/parser": "^5.59.7",
105
- "eslint": "^8.41.0",
106
- "eslint-plugin-jest": "^27.2.1",
100
+ "@types/jest": "^29.5.2",
101
+ "@types/node": "^18.16.18",
102
+ "@types/uuid": "^9.0.2",
103
+ "@typescript-eslint/eslint-plugin": "^5.60.0",
104
+ "@typescript-eslint/parser": "^5.60.0",
105
+ "eslint": "^8.43.0",
106
+ "eslint-plugin-jest": "^27.2.2",
107
107
  "jest": "^29.5.0",
108
- "marked": "^5.0.3",
108
+ "marked": "^5.1.0",
109
109
  "open-cli": "^7.2.0",
110
110
  "pick-port": "^1.0.1",
111
111
  "sctp": "^1.0.0",
112
112
  "ts-jest": "^29.1.0",
113
113
  "tsc-watch": "^6.0.4",
114
- "typescript": "^5.0.4"
114
+ "typescript": "^5.1.3"
115
115
  }
116
116
  }
package/worker/Makefile CHANGED
@@ -208,10 +208,10 @@ xcode: setup
208
208
  $(MESON) setup --buildtype debug --backend xcode $(MEDIASOUP_OUT_DIR)/xcode
209
209
 
210
210
  lint:
211
- $(GULP) --gulpfile ./scripts/gulpfile.js lint:worker
211
+ $(GULP) --gulpfile ./scripts/gulpfile.mjs lint:worker
212
212
 
213
213
  format:
214
- $(GULP) --gulpfile ./scripts/gulpfile.js format:worker
214
+ $(GULP) --gulpfile ./scripts/gulpfile.mjs format:worker
215
215
 
216
216
  test: setup
217
217
  $(MESON) compile -C $(BUILD_DIR) -j $(CORES) mediasoup-worker-test
@@ -1,25 +0,0 @@
1
- const gulp = require('gulp');
2
- const clangFormat = require('gulp-clang-format');
3
-
4
- const workerFiles =
5
- [
6
- '../src/**/*.cpp',
7
- '../include/**/*.hpp',
8
- '../test/src/**/*.cpp',
9
- '../test/include/helpers.hpp',
10
- '../fuzzer/src/**/*.cpp',
11
- '../fuzzer/include/**/*.hpp'
12
- ];
13
-
14
- gulp.task('lint:worker', () =>
15
- {
16
- return gulp.src(workerFiles)
17
- .pipe(clangFormat.checkFormat('file', null, { verbose: true, fail: true }));
18
- });
19
-
20
- gulp.task('format:worker', () =>
21
- {
22
- return gulp.src(workerFiles, { base: '.' })
23
- .pipe(clangFormat.format('file'))
24
- .pipe(gulp.dest('.'));
25
- });