node-datachannel 0.33.0 → 0.33.2
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.
- package/CMakeLists.txt +3 -3
- package/README.md +1 -1
- package/dist/cjs/lib/node-datachannel.cjs +1 -0
- package/dist/cjs/lib/node-datachannel.cjs.map +1 -1
- package/dist/esm/lib/node-datachannel.mjs +1 -0
- package/dist/esm/lib/node-datachannel.mjs.map +1 -1
- package/package.json +10 -9
- package/src/lib/node-datachannel.ts +1 -0
package/CMakeLists.txt
CHANGED
|
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.15)
|
|
|
2
2
|
cmake_policy(SET CMP0091 NEW)
|
|
3
3
|
cmake_policy(SET CMP0042 NEW)
|
|
4
4
|
|
|
5
|
-
project(node_datachannel VERSION 0.33.
|
|
5
|
+
project(node_datachannel VERSION 0.33.2)
|
|
6
6
|
|
|
7
7
|
# compile_commands.json
|
|
8
8
|
# -----------------------------------
|
|
@@ -14,8 +14,9 @@ add_definitions(-DNAPI_VERSION=8)
|
|
|
14
14
|
include_directories(${CMAKE_JS_INC})
|
|
15
15
|
|
|
16
16
|
if(WIN32)
|
|
17
|
-
set(OPENSSL_MSVC_STATIC_RT TRUE)
|
|
18
17
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
|
18
|
+
else()
|
|
19
|
+
set(OPENSSL_USE_STATIC_LIBS TRUE)
|
|
19
20
|
endif()
|
|
20
21
|
|
|
21
22
|
if(ANDROID OR CMAKE_SYSTEM_NAME STREQUAL "Android")
|
|
@@ -27,7 +28,6 @@ if (NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
|
27
28
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frtti")
|
|
28
29
|
endif()
|
|
29
30
|
|
|
30
|
-
set(OPENSSL_USE_STATIC_LIBS TRUE)
|
|
31
31
|
find_package(OpenSSL REQUIRED)
|
|
32
32
|
|
|
33
33
|
include(FetchContent)
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ npm install node-datachannel
|
|
|
23
23
|
| Architecture | Linux (glibc) | Linux (musl / Alpine) | macOS (Apple Silicon / Intel) | Windows | Android (Termux / Bionic) |
|
|
24
24
|
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
25
25
|
| **x64** | `@node-datachannel/linux-x64-gnu` | `@node-datachannel/linux-x64-musl` | `@node-datachannel/darwin-x64` | `@node-datachannel/win32-x64-msvc` | - |
|
|
26
|
-
| **arm64** | `@node-datachannel/linux-arm64-gnu` | `@node-datachannel/linux-arm64-musl` | `@node-datachannel/darwin-arm64` | - | `@node-datachannel/android-arm64` |
|
|
26
|
+
| **arm64** | `@node-datachannel/linux-arm64-gnu` | `@node-datachannel/linux-arm64-musl` | `@node-datachannel/darwin-arm64` | `@node-datachannel/win32-arm64-msvc` | `@node-datachannel/android-arm64` |
|
|
27
27
|
|
|
28
28
|
## Electron
|
|
29
29
|
|
|
@@ -42,6 +42,7 @@ function getPackageName() {
|
|
|
42
42
|
if (arch === "x64") return "@node-datachannel/darwin-x64";
|
|
43
43
|
} else if (platform === "win32") {
|
|
44
44
|
if (arch === "x64") return "@node-datachannel/win32-x64-msvc";
|
|
45
|
+
if (arch === "arm64") return "@node-datachannel/win32-arm64-msvc";
|
|
45
46
|
} else if (platform === "android") {
|
|
46
47
|
if (arch === "arm64") return "@node-datachannel/android-arm64";
|
|
47
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-datachannel.cjs","sources":["../../../src/lib/node-datachannel.ts"],"sourcesContent":["import * as fs from 'fs';\nimport * as path from 'path';\nimport { familySync, MUSL } from 'detect-libc';\n\nfunction getPackageName(): string | null {\n const { platform, arch } = process;\n if (platform === 'linux') {\n const libc = familySync();\n if (libc === MUSL) {\n if (arch === 'x64') return '@node-datachannel/linux-x64-musl';\n if (arch === 'arm64') return '@node-datachannel/linux-arm64-musl';\n } else {\n if (arch === 'x64') return '@node-datachannel/linux-x64-gnu';\n if (arch === 'arm64') return '@node-datachannel/linux-arm64-gnu';\n }\n } else if (platform === 'darwin') {\n if (arch === 'arm64') return '@node-datachannel/darwin-arm64';\n if (arch === 'x64') return '@node-datachannel/darwin-x64';\n } else if (platform === 'win32') {\n if (arch === 'x64') return '@node-datachannel/win32-x64-msvc';\n } else if (platform === 'android') {\n if (arch === 'arm64') return '@node-datachannel/android-arm64';\n }\n return null;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction loadBinding(): any {\n // 1. Try local build candidate paths for development, tests, and source builds\n const candidateLocalPaths = [\n path.resolve(__dirname, '../../build/node_datachannel.node'),\n path.resolve(__dirname, '../../../build/node_datachannel.node'),\n path.resolve(__dirname, '../../build/Release/node_datachannel.node'),\n path.resolve(__dirname, '../../../build/Release/node_datachannel.node'),\n path.resolve(__dirname, '../../build/Debug/node_datachannel.node'),\n path.resolve(__dirname, '../../../build/Debug/node_datachannel.node'),\n ];\n\n let localLoadError: Error | null = null;\n for (const candidate of candidateLocalPaths) {\n if (fs.existsSync(candidate)) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n return require(candidate);\n } catch (err: unknown) {\n localLoadError = err instanceof Error ? err : new Error(String(err));\n }\n }\n }\n\n if (localLoadError) {\n throw new Error(\n `Failed to load local native addon build: ${localLoadError.message}\\n` +\n `Stack: ${localLoadError.stack}`\n );\n }\n\n // 2. Try platform-specific optionalDependencies package\n const pkgName = getPackageName();\n if (pkgName) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n return require(pkgName);\n } catch (err: unknown) {\n const errorMsg = err instanceof Error ? err.message : String(err);\n throw new Error(\n `Cannot load native addon for node-datachannel on ${process.platform} (${process.arch}). ` +\n `Attempted to require \"${pkgName}\". ` +\n `Please ensure optionalDependencies are installed (avoid --no-optional / --omit=optional) ` +\n `or compile locally with \"npm run compile\". (Error: ${errorMsg})`\n );\n }\n }\n\n throw new Error(\n `Unsupported platform/architecture for node-datachannel: ${process.platform} (${process.arch}). ` +\n `Please compile from source using \"npm run compile\".`\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst nodeDataChannel: any = loadBinding();\nexport default nodeDataChannel;\n"],"names":["familySync","MUSL","path","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAAS,cAAgC,GAAA;AACvC,EAAM,MAAA,EAAE,QAAU,EAAA,IAAA,EAAS,GAAA,OAAA,CAAA;AAC3B,EAAA,IAAI,aAAa,OAAS,EAAA;AACxB,IAAA,MAAM,OAAOA,qBAAW,EAAA,CAAA;AACxB,IAAA,IAAI,SAASC,eAAM,EAAA;AACjB,MAAI,IAAA,IAAA,KAAS,OAAc,OAAA,kCAAA,CAAA;AAC3B,MAAI,IAAA,IAAA,KAAS,SAAgB,OAAA,oCAAA,CAAA;AAAA,KACxB,MAAA;AACL,MAAI,IAAA,IAAA,KAAS,OAAc,OAAA,iCAAA,CAAA;AAC3B,MAAI,IAAA,IAAA,KAAS,SAAgB,OAAA,mCAAA,CAAA;AAAA,KAC/B;AAAA,GACF,MAAA,IAAW,aAAa,QAAU,EAAA;AAChC,IAAI,IAAA,IAAA,KAAS,SAAgB,OAAA,gCAAA,CAAA;AAC7B,IAAI,IAAA,IAAA,KAAS,OAAc,OAAA,8BAAA,CAAA;AAAA,GAC7B,MAAA,IAAW,aAAa,OAAS,EAAA;AAC/B,IAAI,IAAA,IAAA,KAAS,OAAc,OAAA,kCAAA,CAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"node-datachannel.cjs","sources":["../../../src/lib/node-datachannel.ts"],"sourcesContent":["import * as fs from 'fs';\nimport * as path from 'path';\nimport { familySync, MUSL } from 'detect-libc';\n\nfunction getPackageName(): string | null {\n const { platform, arch } = process;\n if (platform === 'linux') {\n const libc = familySync();\n if (libc === MUSL) {\n if (arch === 'x64') return '@node-datachannel/linux-x64-musl';\n if (arch === 'arm64') return '@node-datachannel/linux-arm64-musl';\n } else {\n if (arch === 'x64') return '@node-datachannel/linux-x64-gnu';\n if (arch === 'arm64') return '@node-datachannel/linux-arm64-gnu';\n }\n } else if (platform === 'darwin') {\n if (arch === 'arm64') return '@node-datachannel/darwin-arm64';\n if (arch === 'x64') return '@node-datachannel/darwin-x64';\n } else if (platform === 'win32') {\n if (arch === 'x64') return '@node-datachannel/win32-x64-msvc';\n if (arch === 'arm64') return '@node-datachannel/win32-arm64-msvc';\n } else if (platform === 'android') {\n if (arch === 'arm64') return '@node-datachannel/android-arm64';\n }\n return null;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction loadBinding(): any {\n // 1. Try local build candidate paths for development, tests, and source builds\n const candidateLocalPaths = [\n path.resolve(__dirname, '../../build/node_datachannel.node'),\n path.resolve(__dirname, '../../../build/node_datachannel.node'),\n path.resolve(__dirname, '../../build/Release/node_datachannel.node'),\n path.resolve(__dirname, '../../../build/Release/node_datachannel.node'),\n path.resolve(__dirname, '../../build/Debug/node_datachannel.node'),\n path.resolve(__dirname, '../../../build/Debug/node_datachannel.node'),\n ];\n\n let localLoadError: Error | null = null;\n for (const candidate of candidateLocalPaths) {\n if (fs.existsSync(candidate)) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n return require(candidate);\n } catch (err: unknown) {\n localLoadError = err instanceof Error ? err : new Error(String(err));\n }\n }\n }\n\n if (localLoadError) {\n throw new Error(\n `Failed to load local native addon build: ${localLoadError.message}\\n` +\n `Stack: ${localLoadError.stack}`\n );\n }\n\n // 2. Try platform-specific optionalDependencies package\n const pkgName = getPackageName();\n if (pkgName) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n return require(pkgName);\n } catch (err: unknown) {\n const errorMsg = err instanceof Error ? err.message : String(err);\n throw new Error(\n `Cannot load native addon for node-datachannel on ${process.platform} (${process.arch}). ` +\n `Attempted to require \"${pkgName}\". ` +\n `Please ensure optionalDependencies are installed (avoid --no-optional / --omit=optional) ` +\n `or compile locally with \"npm run compile\". (Error: ${errorMsg})`\n );\n }\n }\n\n throw new Error(\n `Unsupported platform/architecture for node-datachannel: ${process.platform} (${process.arch}). ` +\n `Please compile from source using \"npm run compile\".`\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst nodeDataChannel: any = loadBinding();\nexport default nodeDataChannel;\n"],"names":["familySync","MUSL","path","fs"],"mappings":"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"}
|
|
@@ -26,6 +26,7 @@ function getPackageName() {
|
|
|
26
26
|
if (arch === "x64") return "@node-datachannel/darwin-x64";
|
|
27
27
|
} else if (platform === "win32") {
|
|
28
28
|
if (arch === "x64") return "@node-datachannel/win32-x64-msvc";
|
|
29
|
+
if (arch === "arm64") return "@node-datachannel/win32-arm64-msvc";
|
|
29
30
|
} else if (platform === "android") {
|
|
30
31
|
if (arch === "arm64") return "@node-datachannel/android-arm64";
|
|
31
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-datachannel.mjs","sources":["../../../src/lib/node-datachannel.ts"],"sourcesContent":["import * as fs from 'fs';\nimport * as path from 'path';\nimport { familySync, MUSL } from 'detect-libc';\n\nfunction getPackageName(): string | null {\n const { platform, arch } = process;\n if (platform === 'linux') {\n const libc = familySync();\n if (libc === MUSL) {\n if (arch === 'x64') return '@node-datachannel/linux-x64-musl';\n if (arch === 'arm64') return '@node-datachannel/linux-arm64-musl';\n } else {\n if (arch === 'x64') return '@node-datachannel/linux-x64-gnu';\n if (arch === 'arm64') return '@node-datachannel/linux-arm64-gnu';\n }\n } else if (platform === 'darwin') {\n if (arch === 'arm64') return '@node-datachannel/darwin-arm64';\n if (arch === 'x64') return '@node-datachannel/darwin-x64';\n } else if (platform === 'win32') {\n if (arch === 'x64') return '@node-datachannel/win32-x64-msvc';\n } else if (platform === 'android') {\n if (arch === 'arm64') return '@node-datachannel/android-arm64';\n }\n return null;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction loadBinding(): any {\n // 1. Try local build candidate paths for development, tests, and source builds\n const candidateLocalPaths = [\n path.resolve(__dirname, '../../build/node_datachannel.node'),\n path.resolve(__dirname, '../../../build/node_datachannel.node'),\n path.resolve(__dirname, '../../build/Release/node_datachannel.node'),\n path.resolve(__dirname, '../../../build/Release/node_datachannel.node'),\n path.resolve(__dirname, '../../build/Debug/node_datachannel.node'),\n path.resolve(__dirname, '../../../build/Debug/node_datachannel.node'),\n ];\n\n let localLoadError: Error | null = null;\n for (const candidate of candidateLocalPaths) {\n if (fs.existsSync(candidate)) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n return require(candidate);\n } catch (err: unknown) {\n localLoadError = err instanceof Error ? err : new Error(String(err));\n }\n }\n }\n\n if (localLoadError) {\n throw new Error(\n `Failed to load local native addon build: ${localLoadError.message}\\n` +\n `Stack: ${localLoadError.stack}`\n );\n }\n\n // 2. Try platform-specific optionalDependencies package\n const pkgName = getPackageName();\n if (pkgName) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n return require(pkgName);\n } catch (err: unknown) {\n const errorMsg = err instanceof Error ? err.message : String(err);\n throw new Error(\n `Cannot load native addon for node-datachannel on ${process.platform} (${process.arch}). ` +\n `Attempted to require \"${pkgName}\". ` +\n `Please ensure optionalDependencies are installed (avoid --no-optional / --omit=optional) ` +\n `or compile locally with \"npm run compile\". (Error: ${errorMsg})`\n );\n }\n }\n\n throw new Error(\n `Unsupported platform/architecture for node-datachannel: ${process.platform} (${process.arch}). ` +\n `Please compile from source using \"npm run compile\".`\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst nodeDataChannel: any = loadBinding();\nexport default nodeDataChannel;\n"],"names":[],"mappings":";;;;;;;;;;;;AAIA;AACE;AACA;AACE;AACA;AACE;AACA;AAA6B;AAE7B;AACA;AAA6B;AAC/B;AAEA;AACA;AAA2B;AAE3B;
|
|
1
|
+
{"version":3,"file":"node-datachannel.mjs","sources":["../../../src/lib/node-datachannel.ts"],"sourcesContent":["import * as fs from 'fs';\nimport * as path from 'path';\nimport { familySync, MUSL } from 'detect-libc';\n\nfunction getPackageName(): string | null {\n const { platform, arch } = process;\n if (platform === 'linux') {\n const libc = familySync();\n if (libc === MUSL) {\n if (arch === 'x64') return '@node-datachannel/linux-x64-musl';\n if (arch === 'arm64') return '@node-datachannel/linux-arm64-musl';\n } else {\n if (arch === 'x64') return '@node-datachannel/linux-x64-gnu';\n if (arch === 'arm64') return '@node-datachannel/linux-arm64-gnu';\n }\n } else if (platform === 'darwin') {\n if (arch === 'arm64') return '@node-datachannel/darwin-arm64';\n if (arch === 'x64') return '@node-datachannel/darwin-x64';\n } else if (platform === 'win32') {\n if (arch === 'x64') return '@node-datachannel/win32-x64-msvc';\n if (arch === 'arm64') return '@node-datachannel/win32-arm64-msvc';\n } else if (platform === 'android') {\n if (arch === 'arm64') return '@node-datachannel/android-arm64';\n }\n return null;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction loadBinding(): any {\n // 1. Try local build candidate paths for development, tests, and source builds\n const candidateLocalPaths = [\n path.resolve(__dirname, '../../build/node_datachannel.node'),\n path.resolve(__dirname, '../../../build/node_datachannel.node'),\n path.resolve(__dirname, '../../build/Release/node_datachannel.node'),\n path.resolve(__dirname, '../../../build/Release/node_datachannel.node'),\n path.resolve(__dirname, '../../build/Debug/node_datachannel.node'),\n path.resolve(__dirname, '../../../build/Debug/node_datachannel.node'),\n ];\n\n let localLoadError: Error | null = null;\n for (const candidate of candidateLocalPaths) {\n if (fs.existsSync(candidate)) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n return require(candidate);\n } catch (err: unknown) {\n localLoadError = err instanceof Error ? err : new Error(String(err));\n }\n }\n }\n\n if (localLoadError) {\n throw new Error(\n `Failed to load local native addon build: ${localLoadError.message}\\n` +\n `Stack: ${localLoadError.stack}`\n );\n }\n\n // 2. Try platform-specific optionalDependencies package\n const pkgName = getPackageName();\n if (pkgName) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n return require(pkgName);\n } catch (err: unknown) {\n const errorMsg = err instanceof Error ? err.message : String(err);\n throw new Error(\n `Cannot load native addon for node-datachannel on ${process.platform} (${process.arch}). ` +\n `Attempted to require \"${pkgName}\". ` +\n `Please ensure optionalDependencies are installed (avoid --no-optional / --omit=optional) ` +\n `or compile locally with \"npm run compile\". (Error: ${errorMsg})`\n );\n }\n }\n\n throw new Error(\n `Unsupported platform/architecture for node-datachannel: ${process.platform} (${process.arch}). ` +\n `Please compile from source using \"npm run compile\".`\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst nodeDataChannel: any = loadBinding();\nexport default nodeDataChannel;\n"],"names":[],"mappings":";;;;;;;;;;;;AAIA;AACE;AACA;AACE;AACA;AACE;AACA;AAA6B;AAE7B;AACA;AAA6B;AAC/B;AAEA;AACA;AAA2B;AAE3B;AACA;AAA6B;AAE7B;AAA6B;AAE/B;AACF;AAGA;AAEE;AAA4B;AACiC;AACG;AACK;AACG;AACL;AACG;AAGtE;AACA;AACE;AACE;AAEE;AAAwB;AAExB;AAAmE;AACrE;AACF;AAGF;AACE;AAAU;AAC0D;AAClC;AAClC;AAIF;AACA;AACE;AAEE;AAAsB;AAEtB;AACA;AAAU;AAIwD;AAClE;AACF;AAGF;AAAU;AACoF;AAGhG;AAGA;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-datachannel",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.2",
|
|
4
4
|
"description": "WebRTC For Node.js and Electron. libdatachannel node bindings.",
|
|
5
5
|
"main": "./dist/cjs/lib/index.cjs",
|
|
6
6
|
"module": "./dist/esm/lib/index.mjs",
|
|
@@ -118,13 +118,14 @@
|
|
|
118
118
|
"detect-libc": "^2.0.4"
|
|
119
119
|
},
|
|
120
120
|
"optionalDependencies": {
|
|
121
|
-
"@node-datachannel/android-arm64": "0.33.
|
|
122
|
-
"@node-datachannel/darwin-arm64": "0.33.
|
|
123
|
-
"@node-datachannel/darwin-x64": "0.33.
|
|
124
|
-
"@node-datachannel/linux-arm64-gnu": "0.33.
|
|
125
|
-
"@node-datachannel/linux-arm64-musl": "0.33.
|
|
126
|
-
"@node-datachannel/linux-x64-gnu": "0.33.
|
|
127
|
-
"@node-datachannel/linux-x64-musl": "0.33.
|
|
128
|
-
"@node-datachannel/win32-
|
|
121
|
+
"@node-datachannel/android-arm64": "0.33.2",
|
|
122
|
+
"@node-datachannel/darwin-arm64": "0.33.2",
|
|
123
|
+
"@node-datachannel/darwin-x64": "0.33.2",
|
|
124
|
+
"@node-datachannel/linux-arm64-gnu": "0.33.2",
|
|
125
|
+
"@node-datachannel/linux-arm64-musl": "0.33.2",
|
|
126
|
+
"@node-datachannel/linux-x64-gnu": "0.33.2",
|
|
127
|
+
"@node-datachannel/linux-x64-musl": "0.33.2",
|
|
128
|
+
"@node-datachannel/win32-arm64-msvc": "0.33.2",
|
|
129
|
+
"@node-datachannel/win32-x64-msvc": "0.33.2"
|
|
129
130
|
}
|
|
130
131
|
}
|
|
@@ -18,6 +18,7 @@ function getPackageName(): string | null {
|
|
|
18
18
|
if (arch === 'x64') return '@node-datachannel/darwin-x64';
|
|
19
19
|
} else if (platform === 'win32') {
|
|
20
20
|
if (arch === 'x64') return '@node-datachannel/win32-x64-msvc';
|
|
21
|
+
if (arch === 'arm64') return '@node-datachannel/win32-arm64-msvc';
|
|
21
22
|
} else if (platform === 'android') {
|
|
22
23
|
if (arch === 'arm64') return '@node-datachannel/android-arm64';
|
|
23
24
|
}
|