Skip to content

Commit 419d66a

Browse files
Merge branch 'release/v4.2.0' into stable
2 parents 74b603a + a4a7bb9 commit 419d66a

File tree

506 files changed

+15748
-16518
lines changed

Some content is hidden

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

506 files changed

+15748
-16518
lines changed

.eslintignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ node_modules
22
*.log
33
*.keys
44

5-
demo/full/bundle.js
6-
demo/full/lib.js
7-
demo/standalone/lib.js
85
demo/bundle.js
6+
demo/lib.js
97

108
tools/tests/coverage/
119

.eslintrc.js

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = {
3232
},
3333
],
3434
"@typescript-eslint/await-thenable": "error",
35-
"@typescript-eslint/ban-types": [
35+
"@typescript-eslint/no-restricted-types": [
3636
"error",
3737
{
3838
types: {
@@ -55,6 +55,22 @@ module.exports = {
5555
Symbol: {
5656
message: "Avoid using the `Symbol` type. Did you mean `symbol`?",
5757
},
58+
HTMLMediaElement: {
59+
message:
60+
"Avoid relying on `HTMLMediaElement` directly unless it is API-facing. Prefer our more restricted `IMediaElement` type",
61+
},
62+
MediaSource: {
63+
message:
64+
"Avoid relying on `MediaSource` directly unless it is API-facing. Prefer our more restricted `IMediaSource` type",
65+
},
66+
SourceBuffer: {
67+
message:
68+
"Avoid relying on `SourceBuffer` directly unless it is API-facing. Prefer our more restricted `ISourceBuffer` type",
69+
},
70+
SourceBufferList: {
71+
message:
72+
"Avoid relying on `SourceBufferList` directly unless it is API-facing. Prefer our more restricted `ISourceBufferList` type",
73+
},
5874
},
5975
},
6076
],
@@ -65,6 +81,8 @@ module.exports = {
6581
objectLiteralTypeAssertions: "allow",
6682
},
6783
],
84+
"@typescript-eslint/prefer-promise-reject-errors": "off",
85+
"@typescript-eslint/only-throw-error": "off",
6886
"@typescript-eslint/consistent-type-definitions": "error",
6987
"@typescript-eslint/dot-notation": "error",
7088
"@typescript-eslint/explicit-member-accessibility": [
@@ -127,6 +145,15 @@ module.exports = {
127145
leadingUnderscore: "allow",
128146
},
129147
],
148+
"@typescript-eslint/no-duplicate-type-constituents": [
149+
"error",
150+
{
151+
ignoreIntersections: false,
152+
// We sadly have to disable this one because there's many cases where
153+
// this is done on purpose
154+
ignoreUnions: true,
155+
},
156+
],
130157
"@typescript-eslint/no-empty-function": "error",
131158
"@typescript-eslint/no-empty-interface": "error",
132159
"@typescript-eslint/no-explicit-any": "error",
@@ -155,18 +182,14 @@ module.exports = {
155182
"@typescript-eslint/no-unused-vars": [
156183
"error",
157184
{
185+
args: "all",
158186
argsIgnorePattern: "^_",
187+
caughtErrors: "none",
188+
destructuredArrayIgnorePattern: "^_",
159189
varsIgnorePattern: "^_",
160190
},
161191
],
162192
"@typescript-eslint/no-shadow": ["error"],
163-
"@typescript-eslint/quotes": [
164-
"error",
165-
"double",
166-
{
167-
avoidEscape: true,
168-
},
169-
],
170193
"@typescript-eslint/restrict-plus-operands": "error",
171194
"@typescript-eslint/strict-boolean-expressions": "error",
172195
"@typescript-eslint/triple-slash-reference": [

.github/workflows/checks.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3-
41
name: RxPlayer Tests
52

63
on:
@@ -29,7 +26,7 @@ jobs:
2926
with:
3027
toolchain: stable
3128

32-
- run: npm install
29+
- run: npm ci
3330
- run: rustup target add wasm32-unknown-unknown
3431
- run: npm run fmt:prettier:check
3532
- run: npm run fmt:rust:check
@@ -49,7 +46,7 @@ jobs:
4946
with:
5047
node-version: ${{ matrix.node-version }}
5148
cache: "npm"
52-
- run: npm install
49+
- run: npm ci
5350
- run: npm run check
5451

5552
unit_tests:
@@ -67,7 +64,7 @@ jobs:
6764
with:
6865
node-version: ${{ matrix.node-version }}
6966
cache: "npm"
70-
- run: npm install
67+
- run: npm ci
7168
- run: npm run test:unit
7269

7370
integration_linux:
@@ -89,10 +86,8 @@ jobs:
8986
- run:
9087
sudo add-apt-repository multiverse && sudo apt update && sudo apt install -y
9188
ubuntu-restricted-extras
92-
- run: npm install
89+
- run: npm ci
9390
- run: npm run build
94-
# Firefox seems to have issue with integration tests on GitHub actions only
95-
# TODO to check
9691
- run: npm run test:integration
9792

9893
memory_linux:
@@ -114,7 +109,5 @@ jobs:
114109
- run:
115110
sudo add-apt-repository multiverse && sudo apt update && sudo apt install -y
116111
ubuntu-restricted-extras
117-
- run: npm install
118-
# Firefox seems to have issue with integration tests on GitHub actions only
119-
# TODO to check
112+
- run: npm ci
120113
- run: npm run test:memory

.github/workflows/demo_check.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: RxPlayer Demo Checks
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
paths:
7+
- demo/**
8+
9+
jobs:
10+
scripts_lint:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [20.x]
16+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v2
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: "npm"
25+
- run: npm ci
26+
- run: npm run check:demo

.github/workflows/perfs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- run:
1919
sudo add-apt-repository multiverse && sudo apt update && sudo apt install -y
2020
ubuntu-restricted-extras
21-
- run: npm install
21+
- run: npm ci
2222
- run: export DISPLAY=:99
2323
- run: sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
2424
- run: node tests/performance/run.mjs
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Publish autobuild package
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened, labeled]
5+
6+
jobs:
7+
inform-autobuild:
8+
if: ${{github.repository != 'canalplus/rx-player' && github.event.action == 'opened'}}
9+
runs-on: [ubuntu-latest]
10+
permissions:
11+
pull-requests: write
12+
steps:
13+
- name: Comment PR
14+
uses: actions/github-script@v6
15+
with:
16+
script: |
17+
github.rest.issues.createComment({
18+
issue_number: context.issue.number,
19+
owner: context.repo.owner,
20+
repo: context.repo.repo,
21+
body: `You can deploy a built version of the RxPlayer with the current branch by adding the label \`deploy\` to the pull request.
22+
This will create a release on your github fork with name \`autobuild.${{ github.sha }}\` `
23+
})
24+
25+
publish-autobuild-package:
26+
# This action only runs on forks because it pushes a new release.
27+
# It is not wanted on the main repository as it would spam the releases.
28+
if:
29+
${{github.repository != 'canalplus/rx-player' && (github.event.action == 'opened' ||
30+
github.event.action == 'synchronize' || github.event.action == 'reopened') &&
31+
contains(github.event.pull_request.labels.*.name, 'deploy') || github.event.action
32+
== 'labeled' && github.event.label.name == 'deploy'}}
33+
34+
runs-on: [ubuntu-latest]
35+
permissions:
36+
packages: write
37+
contents: write
38+
pull-requests: write
39+
40+
steps:
41+
- uses: actions/checkout@v2
42+
- uses: actions/setup-node@v2
43+
with:
44+
node-version: 20
45+
scope: "@${{ github.repository_owner }}"
46+
registry-url: "https://npm.pkg.github.com"
47+
env:
48+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Install dependencies
51+
run: npm ci
52+
53+
- name: Build Library
54+
run: npm run build:noCheck
55+
56+
- name: Create archive
57+
run: echo "npm-pack=$(npm pack)" >> $GITHUB_OUTPUT
58+
id: npm-pack
59+
60+
- name: Upload archive to release
61+
uses: svenstaro/upload-release-action@v2
62+
id: upload-action
63+
with:
64+
repo_token: ${{ secrets.GITHUB_TOKEN }}
65+
file: ${{ steps.npm-pack.outputs.npm-pack }}
66+
asset_name: rx-player.tgz
67+
tag: "autobuild.${{ github.sha }}"
68+
release_name: "autobuild.${{ github.sha }}"
69+
overwrite: true
70+
body:
71+
"Autobuild from branch ${{github.ref_name}}, commit hash: ${{github.sha}},
72+
date: ${{ github.event.repository.updated_at }}"
73+
74+
- name: Comment PR
75+
uses: actions/github-script@v6
76+
with:
77+
script: |
78+
github.rest.issues.createComment({
79+
issue_number: context.issue.number,
80+
owner: context.repo.owner,
81+
repo: context.repo.repo,
82+
body: `A built version of the branch has been deployed to the following URL:
83+
${{steps.upload-action.outputs.browser_download_url}}
84+
85+
You can import it by changing your \`package.json\`:
86+
\`\`\`json
87+
"rx-player": "${{steps.upload-action.outputs.browser_download_url}}"
88+
\`\`\`
89+
Then run:
90+
\`npm install\``
91+
})

.github/workflows/script_check.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: RxPlayer Script Checks
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
paths:
7+
- scripts/**
8+
9+
jobs:
10+
scripts_lint:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [20.x]
16+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v2
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: "npm"
25+
- run: npm ci
26+
- run: npm run lint:scripts

.github/workflows/tests_check.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: RxPlayer Tests Checks
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
paths:
7+
- tests/**
8+
9+
jobs:
10+
tests_lint:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [20.x]
16+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v2
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: "npm"
25+
- run: npm ci
26+
- run: npm run lint:tests

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
/localhost.key
44
/node_modules
55

6-
/demo/full/bundle.js
7-
/demo/full/worker.js
8-
/demo/standalone/lib.js
6+
/demo/bundle.js
7+
/demo/worker.js
98

109
/tests/performance/node_modules
1110
/tests/performance/bundle1.js
@@ -23,3 +22,5 @@
2322
# IDE files
2423
/.idea
2524
/.vscode
25+
26+
.DS_Store

.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/localhost.key
88
/node_modules
99
/webpack-demo.config.mjs
10-
10+
/tmp
1111
/demo
1212

1313
/tests

0 commit comments

Comments
 (0)