Skip to content

Commit

Permalink
Merge branch 'release/v4.2.0' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Florent-Bouisset committed Oct 17, 2024
2 parents 74b603a + a4a7bb9 commit 380d370
Show file tree
Hide file tree
Showing 506 changed files with 15,749 additions and 16,518 deletions.
4 changes: 1 addition & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ node_modules
*.log
*.keys

demo/full/bundle.js
demo/full/lib.js
demo/standalone/lib.js
demo/bundle.js
demo/lib.js

tools/tests/coverage/

Expand Down
39 changes: 31 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {
},
],
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-types": [
"@typescript-eslint/no-restricted-types": [
"error",
{
types: {
Expand All @@ -55,6 +55,22 @@ module.exports = {
Symbol: {
message: "Avoid using the `Symbol` type. Did you mean `symbol`?",
},
HTMLMediaElement: {
message:
"Avoid relying on `HTMLMediaElement` directly unless it is API-facing. Prefer our more restricted `IMediaElement` type",
},
MediaSource: {
message:
"Avoid relying on `MediaSource` directly unless it is API-facing. Prefer our more restricted `IMediaSource` type",
},
SourceBuffer: {
message:
"Avoid relying on `SourceBuffer` directly unless it is API-facing. Prefer our more restricted `ISourceBuffer` type",
},
SourceBufferList: {
message:
"Avoid relying on `SourceBufferList` directly unless it is API-facing. Prefer our more restricted `ISourceBufferList` type",
},
},
},
],
Expand All @@ -65,6 +81,8 @@ module.exports = {
objectLiteralTypeAssertions: "allow",
},
],
"@typescript-eslint/prefer-promise-reject-errors": "off",
"@typescript-eslint/only-throw-error": "off",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "error",
"@typescript-eslint/explicit-member-accessibility": [
Expand Down Expand Up @@ -127,6 +145,15 @@ module.exports = {
leadingUnderscore: "allow",
},
],
"@typescript-eslint/no-duplicate-type-constituents": [
"error",
{
ignoreIntersections: false,
// We sadly have to disable this one because there's many cases where
// this is done on purpose
ignoreUnions: true,
},
],
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
Expand Down Expand Up @@ -155,18 +182,14 @@ module.exports = {
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "none",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-shadow": ["error"],
"@typescript-eslint/quotes": [
"error",
"double",
{
avoidEscape: true,
},
],
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/strict-boolean-expressions": "error",
"@typescript-eslint/triple-slash-reference": [
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# 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
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: RxPlayer Tests

on:
Expand Down Expand Up @@ -29,7 +26,7 @@ jobs:
with:
toolchain: stable

- run: npm install
- run: npm ci
- run: rustup target add wasm32-unknown-unknown
- run: npm run fmt:prettier:check
- run: npm run fmt:rust:check
Expand All @@ -49,7 +46,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm install
- run: npm ci
- run: npm run check

unit_tests:
Expand All @@ -67,7 +64,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm install
- run: npm ci
- run: npm run test:unit

integration_linux:
Expand All @@ -89,10 +86,8 @@ jobs:
- run:
sudo add-apt-repository multiverse && sudo apt update && sudo apt install -y
ubuntu-restricted-extras
- run: npm install
- run: npm ci
- run: npm run build
# Firefox seems to have issue with integration tests on GitHub actions only
# TODO to check
- run: npm run test:integration

memory_linux:
Expand All @@ -114,7 +109,5 @@ jobs:
- run:
sudo add-apt-repository multiverse && sudo apt update && sudo apt install -y
ubuntu-restricted-extras
- run: npm install
# Firefox seems to have issue with integration tests on GitHub actions only
# TODO to check
- run: npm ci
- run: npm run test:memory
26 changes: 26 additions & 0 deletions .github/workflows/demo_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: RxPlayer Demo Checks

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- demo/**

jobs:
scripts_lint:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm run check:demo
2 changes: 1 addition & 1 deletion .github/workflows/perfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- run:
sudo add-apt-repository multiverse && sudo apt update && sudo apt install -y
ubuntu-restricted-extras
- run: npm install
- run: npm ci
- run: export DISPLAY=:99
- run: sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
- run: node tests/performance/run.mjs
91 changes: 91 additions & 0 deletions .github/workflows/publish_test_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Publish autobuild package
on:
pull_request:
types: [opened, synchronize, reopened, labeled]

jobs:
inform-autobuild:
if: ${{github.repository != 'canalplus/rx-player' && github.event.action == 'opened'}}
runs-on: [ubuntu-latest]
permissions:
pull-requests: write
steps:
- name: Comment PR
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `You can deploy a built version of the RxPlayer with the current branch by adding the label \`deploy\` to the pull request.
This will create a release on your github fork with name \`autobuild.${{ github.sha }}\` `
})
publish-autobuild-package:
# This action only runs on forks because it pushes a new release.
# It is not wanted on the main repository as it would spam the releases.
if:
${{github.repository != 'canalplus/rx-player' && (github.event.action == 'opened' ||
github.event.action == 'synchronize' || github.event.action == 'reopened') &&
contains(github.event.pull_request.labels.*.name, 'deploy') || github.event.action
== 'labeled' && github.event.label.name == 'deploy'}}

runs-on: [ubuntu-latest]
permissions:
packages: write
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 20
scope: "@${{ github.repository_owner }}"
registry-url: "https://npm.pkg.github.com"
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: npm ci

- name: Build Library
run: npm run build:noCheck

- name: Create archive
run: echo "npm-pack=$(npm pack)" >> $GITHUB_OUTPUT
id: npm-pack

- name: Upload archive to release
uses: svenstaro/upload-release-action@v2
id: upload-action
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.npm-pack.outputs.npm-pack }}
asset_name: rx-player.tgz
tag: "autobuild.${{ github.sha }}"
release_name: "autobuild.${{ github.sha }}"
overwrite: true
body:
"Autobuild from branch ${{github.ref_name}}, commit hash: ${{github.sha}},
date: ${{ github.event.repository.updated_at }}"

- name: Comment PR
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `A built version of the branch has been deployed to the following URL:
${{steps.upload-action.outputs.browser_download_url}}
You can import it by changing your \`package.json\`:
\`\`\`json
"rx-player": "${{steps.upload-action.outputs.browser_download_url}}"
\`\`\`
Then run:
\`npm install\``
})
26 changes: 26 additions & 0 deletions .github/workflows/script_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: RxPlayer Script Checks

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- scripts/**

jobs:
scripts_lint:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm run lint:scripts
26 changes: 26 additions & 0 deletions .github/workflows/tests_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: RxPlayer Tests Checks

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- tests/**

jobs:
tests_lint:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm run lint:tests
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
/localhost.key
/node_modules

/demo/full/bundle.js
/demo/full/worker.js
/demo/standalone/lib.js
/demo/bundle.js
/demo/worker.js

/tests/performance/node_modules
/tests/performance/bundle1.js
Expand All @@ -23,3 +22,5 @@
# IDE files
/.idea
/.vscode

.DS_Store
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/localhost.key
/node_modules
/webpack-demo.config.mjs

/tmp
/demo

/tests
Expand Down
Loading

0 comments on commit 380d370

Please sign in to comment.