Skip to content

Commit 7b79f16

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feat/accept-peer-connection-in-polyfill
2 parents 176cad2 + 5eb8107 commit 7b79f16

File tree

138 files changed

+26926
-11294
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+26926
-11294
lines changed

.eslintignore

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
node_modules
2-
build
2+
build
3+
dist
4+
/**/*.js
5+
jest.config.ts
6+
rollup.config.mjs
7+
test/wpt-tests/
8+
examples

.eslintrc.cjs

-8
This file was deleted.

.eslintrc.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"env": {
3+
"browser": false,
4+
"es6": true,
5+
"node": true
6+
},
7+
"parser": "@typescript-eslint/parser",
8+
"parserOptions": {
9+
"project": "tsconfig.json",
10+
"sourceType": "module",
11+
"ecmaVersion": 2020
12+
},
13+
"plugins": ["@typescript-eslint", "jest"],
14+
"extends": [
15+
"eslint:recommended",
16+
"plugin:@typescript-eslint/recommended",
17+
"plugin:jest/recommended",
18+
"prettier"
19+
],
20+
"rules": {
21+
// The following rule is enabled only to supplement the inline suppression
22+
// examples, and because it is not a recommended rule, you should either
23+
// disable it, or understand what it enforces.
24+
// https://typescript-eslint.io/rules/explicit-function-return-type/
25+
"@typescript-eslint/explicit-function-return-type": "warn"
26+
}
27+
}

.github/workflows/build-linux.yml

+80-82
Original file line numberDiff line numberDiff line change
@@ -14,98 +14,96 @@ jobs:
1414
runs-on: ubuntu-20.04
1515
strategy:
1616
matrix:
17-
node-version: [ 16.x]
17+
node-version: [18]
18+
arch: [amd64, arm64, arm]
19+
platform: [debian, alpine]
20+
include:
21+
# Set baselines per platform
22+
- triple: "alpine-linux-musl"
23+
platform: alpine
24+
version: 3.16
25+
libc: musl
26+
gcc_install: clang lld
27+
gcc: clang
28+
gxx: clang++
29+
# libc is intentionally not set here, as prebuild-install requires libc to not be set for glibc builds
30+
- triple: "linux-gnu"
31+
platform: debian
32+
version: bullseye
33+
# Set baselines per architecture
34+
- triple_arch: x86_64
35+
node_arch: x64
36+
arch: amd64
37+
- triple_arch: armv7
38+
node_arch: arm
39+
triple_postfix: eabihf
40+
arch: arm
41+
flags: -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -fPIC
42+
- triple_arch: aarch64
43+
node_arch: arm64
44+
arch: arm64
45+
flags: -march=armv8-a -fPIC
46+
# Set edge case overrides for specific platform + architecture
47+
# also define gcc commands for each architecture
48+
- arch: amd64
49+
platform: debian
50+
gcc_install: gcc g++
51+
gcc: gcc
52+
gxx: g++
53+
- arch: arm64
54+
platform: debian
55+
gcc_install: gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
56+
gcc: aarch64-linux-gnu-gcc
57+
gxx: aarch64-linux-gnu-g++
58+
# debian uses the triple `arm-linux-gnueabihf` instead of alpine's `armv7-alpine-linux-musleabihf`
59+
# because of this, we explicitly override triple_arch for debian arm
60+
- triple_arch: arm
61+
arch: arm
62+
platform: debian
63+
gcc_install: gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
64+
gcc: arm-linux-gnueabihf-gcc
65+
gxx: arm-linux-gnueabihf-g++
1866

1967
steps:
20-
- uses: actions/checkout@v2
68+
- uses: actions/checkout@v4
2169
- name: Use Node.js ${{ matrix.node-version }}
22-
uses: actions/setup-node@v1
70+
uses: actions/setup-node@v4
2371
with:
2472
node-version: ${{ matrix.node-version }}
25-
- name: Build
26-
run: npm install --build-from-source
73+
- name: Install node dependencies
74+
run: npm install --ignore-scripts
2775
env:
2876
CI: true
29-
- name: Test
30-
run: npm run test
31-
env:
32-
CI: true
33-
- name: Upload
34-
run: node_modules/.bin/prebuild -r napi --upload -u ${{ secrets.GITHUB_TOKEN }}
35-
env:
36-
CI: true
37-
38-
build-linux-armv7:
39-
runs-on: ubuntu-20.04
40-
41-
strategy:
42-
matrix:
43-
node-version: [16.x]
44-
steps:
45-
- uses: actions/checkout@v2
46-
- name: Prepare Cross Compile
47-
run: |
48-
sudo apt update
49-
sudo apt install -y g++-arm-linux-gnueabihf gcc-arm-linux-gnueabihf
50-
mkdir sysroot && cd sysroot
51-
wget https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/ef5c4f84bcafb7a3796d36bb1db7826317dde51c/debian_sid_arm_sysroot.tar.xz
52-
tar xf debian_sid_arm_sysroot.tar.xz
53-
echo "ARM_SYSROOT=$(pwd)" >> $GITHUB_ENV
54-
ls -l
55-
- name: Use Node.js ${{ matrix.node-version }}
56-
uses: actions/setup-node@v1
77+
- if: matrix.arch != 'amd64'
78+
name: Set up QEMU
79+
uses: docker/setup-qemu-action@v3
5780
with:
58-
node-version: ${{ matrix.node-version }}
59-
- name: Build & Upload
81+
platforms: ${{ matrix.arch }}
82+
- name: Install system dependencies
6083
run: |
61-
npm install --ignore-scripts
62-
node_modules/.bin/prebuild -r napi --backend cmake-js --arch arm --upload -u ${{ secrets.GITHUB_TOKEN }} -- --CDCMAKE_TOOLCHAIN_FILE:FILEPATH=./cmake/toolchain/armv7.cmake
84+
sudo apt update
85+
sudo apt install -y podman ninja-build ${{ matrix.gcc_install }}
86+
- name: List installed libc
87+
run: apt list --installed | grep libc6-dev
88+
- name: Build sysroot
89+
run: sudo podman build --isolation=chroot -t ndc-buildroot:${{ matrix.platform }}-${{ matrix.arch }} ./build-containers --file Dockerfile.${{ matrix.platform }} --platform linux/${{ matrix.arch }} --build-arg="version=${{ matrix.version }}" --build-arg="node_version=${{ matrix.node-version }}"
90+
- name: Mount sysroot
91+
id: sysroot
92+
run: echo "sysroot=$(sudo podman image mount ndc-buildroot:${{ matrix.platform }}-${{ matrix.arch }})" >> $GITHUB_OUTPUT
93+
- name: Build
94+
run: sudo --preserve-env=SYSROOT,TRIPLE,COMPILER_FLAGS,LIBC,GCC,GXX,CI,PATH node_modules/.bin/prebuild --arch ${{ matrix.node_arch }} -r napi --backend cmake-js -- --CDCMAKE_TOOLCHAIN_FILE:FILEPATH=./cmake/toolchain/ci.cmake
6395
env:
96+
SYSROOT: ${{ steps.sysroot.outputs.sysroot }}
97+
TRIPLE: ${{ matrix.triple_arch }}-${{ matrix.triple }}${{ matrix.triple_postfix }}
98+
COMPILER_FLAGS: ${{ matrix.flags }}
99+
LIBC: ${{ matrix.libc }}
100+
GCC: ${{ matrix.gcc }}
101+
GXX: ${{ matrix.gxx }}
64102
CI: true
65-
66-
build-linux-arm64:
67-
runs-on: ubuntu-20.04
68-
69-
strategy:
70-
matrix:
71-
node-version: [16.x]
72-
steps:
73-
- uses: actions/checkout@v2
74-
- name: Prepare Cross Compile
75-
run: |
76-
sudo apt update
77-
sudo apt install -y g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
78-
mkdir sysroot && cd sysroot
79-
wget https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/41a6c8dec4c4304d6509e30cbaf9218dffb4438e/debian_bullseye_arm64_sysroot.tar.xz
80-
tar xf debian_bullseye_arm64_sysroot.tar.xz
81-
echo "ARM64_SYSROOT=$(pwd)" >> $GITHUB_ENV
82-
ls -l
83-
- name: Use Node.js ${{ matrix.node-version }}
84-
uses: actions/setup-node@v1
85-
with:
86-
node-version: ${{ matrix.node-version }}
87-
- name: Build & Upload
88-
run: |
89-
npm install --ignore-scripts
90-
node_modules/.bin/prebuild -r napi --backend cmake-js --arch arm64 --upload -u ${{ secrets.GITHUB_TOKEN }} -- --CDCMAKE_TOOLCHAIN_FILE:FILEPATH=./cmake/toolchain/arm64.cmake
103+
- name: Test
104+
run: sudo podman run --rm -v $(pwd):/usr/app/ -e CI=true --platform linux/${{ matrix.arch }} -t ndc-buildroot:${{ matrix.platform }}-${{ matrix.arch }} npm run test
105+
- name: Upload
106+
run: sudo --preserve-env=CI,LIBC node_modules/.bin/prebuild --arch ${{ matrix.node_arch }} -r napi --upload -u ${{ secrets.GITHUB_TOKEN }}
91107
env:
108+
LIBC: ${{ matrix.libc }}
92109
CI: true
93-
94-
# npm-publish:
95-
# needs: [build-linux, build-linux-armv7, build-linux-arm64]
96-
# name: npm-publish
97-
# runs-on: ubuntu-latest
98-
# steps:
99-
# - name: Checkout repository
100-
# uses: actions/checkout@v2
101-
# - name: Set up Node.js
102-
# uses: actions/setup-node@v1
103-
# with:
104-
# node-version: 16.x
105-
# registry-url: "https://registry.npmjs.org"
106-
# - name: Publish
107-
# run: |
108-
# npm install
109-
# npm publish
110-
# env:
111-
# NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

.github/workflows/build-mac-m1.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,26 @@ on:
66
# tags:
77
# - v*
88

9+
910
env:
1011
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
1112

1213
jobs:
1314
build-macos:
14-
runs-on: macos-11
15+
runs-on: macos-13
1516
strategy:
1617
matrix:
17-
node-version: [16.x]
18+
node-version: [18]
1819

1920
steps:
20-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2122
- name: Install OpenSSL
2223
run: |
23-
wget https://mac.r-project.org/bin/darwin20/arm64/openssl-1.1.1o-darwin.20-arm64.tar.xz
24-
tar -xf openssl-1.1.1o-darwin.20-arm64.tar.xz -C /tmp
25-
rm -rf openssl-1.1.1o-darwin.20-arm64.tar.xz
24+
wget https://mac.r-project.org/bin/darwin20/arm64/openssl-1.1.1t-darwin.20-arm64.tar.xz
25+
tar -xf openssl-1.1.1t-darwin.20-arm64.tar.xz -C /tmp
26+
rm -rf openssl-1.1.1t-darwin.20-arm64.tar.xz
2627
- name: Use Node.js ${{ matrix.node-version }}
27-
uses: actions/setup-node@v3
28+
uses: actions/setup-node@v4
2829
with:
2930
node-version: ${{ matrix.node-version }}
3031
- name: Build

.github/workflows/build-mac-x64.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@ env:
1111

1212
jobs:
1313
build-macos:
14-
runs-on: macos-11
14+
runs-on: macos-13
1515
strategy:
1616
matrix:
17-
node-version: [16.x]
17+
node-version: [18]
1818

1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v4
2121
- name: Install OpenSSL
22-
run: HOMEBREW_NO_INSTALL_CLEANUP=1 brew reinstall openssl@1.1
22+
run: HOMEBREW_NO_INSTALL_CLEANUP=1 brew reinstall openssl@3
2323
- name: Use Node.js ${{ matrix.node-version }}
24-
uses: actions/setup-node@v1
24+
uses: actions/setup-node@v4
2525
with:
2626
node-version: ${{ matrix.node-version }}
2727
- name: Build
2828
run: npm install --build-from-source
2929
env:
3030
CI: true
31-
OPENSSL_ROOT_DIR: /usr/local/opt/openssl
32-
OPENSSL_LIBRARIES: /usr/local/opt/openssl/lib
31+
OPENSSL_ROOT_DIR: /usr/local/opt/openssl@3
32+
OPENSSL_LIBRARIES: /usr/local/opt/openssl@3/lib
3333
- name: Test
3434
run: npm run test
3535
env:

.github/workflows/build-win.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,21 @@ env:
1111

1212
jobs:
1313
build-windows-x64:
14-
runs-on: windows-2019
14+
runs-on: windows-2022
1515
strategy:
1616
matrix:
17-
node-version: [16.x]
17+
node-version: [18]
1818

1919
steps:
20-
- uses: actions/checkout@v2
21-
- uses: ilammy/msvc-dev-cmd@v1
20+
- uses: actions/checkout@v4
2221
- name: Install OpenSSL
23-
run: choco install openssl
22+
run: choco install openssl -y
2423
- name: Use Node.js ${{ matrix.node-version }}
25-
uses: actions/setup-node@v1
24+
uses: actions/setup-node@v4
2625
with:
2726
node-version: ${{ matrix.node-version }}
2827
- name: Build
29-
run: set npm_config_cache= && set NPM_CONFIG_CACHE= && npm install --build-from-source
28+
run: npm install --build-from-source
3029
env:
3130
CI: true
3231
# - name: Test
@@ -42,11 +41,11 @@ jobs:
4241
runs-on: windows-2019
4342
strategy:
4443
matrix:
45-
node_version: [16.x]
44+
node_version: [18]
4645
node_arch:
4746
- x86
4847
steps:
49-
- uses: actions/checkout@v2
48+
- uses: actions/checkout@v4
5049
- uses: ilammy/msvc-dev-cmd@v1
5150
with:
5251
arch: x86
@@ -61,7 +60,7 @@ jobs:
6160
node-version: ${{ matrix.node_version }}
6261
node-arch: ${{ matrix.node_arch }}
6362
- name: Build
64-
run: set npm_config_cache= && set NPM_CONFIG_CACHE= && npm install --build-from-source
63+
run: npm install --build-from-source
6564
env:
6665
CI: true
6766
# - name: Test
@@ -72,3 +71,4 @@ jobs:
7271
run: node_modules/.bin/prebuild -r napi --upload -u ${{ secrets.GITHUB_TOKEN }}
7372
env:
7473
CI: true
74+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

.github/workflows/lint.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
- name: Use Node.js
1515
uses: actions/setup-node@v3
1616
with:
17-
node-version: '16.x'
17+
node-version: '18'
1818
- run: npm ci
1919
- run: npm run lint
20-
- run: npm run test-types

.github/workflows/npm-publish-manual.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
registry-url: "https://registry.npmjs.org"
1818
- name: Publish
1919
run: |
20-
npm install
20+
npm install --ignore-scripts
2121
npm publish
2222
env:
2323
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
build
2+
dist
23
prebuilds
34
node_modules
45
.vscode
56
tmp
7+
coverage

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "test/wpt-tests/wpt"]
2+
path = test/wpt-tests/wpt
3+
url = https://github.com/web-platform-tests/wpt.git

.npmignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
build
2+
prebuilds
3+
node_modules
4+
.vscode
5+
tmp
6+
coverage
7+
test
8+
.github
9+
build-containers
10+
examples
11+
cmake

0 commit comments

Comments
 (0)