Skip to content

Commit

Permalink
Merge branch 'versatica:v3' into fix_tcc_feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
penguinol authored Jan 31, 2024
2 parents 096e48f + 01075b1 commit e027f54
Show file tree
Hide file tree
Showing 257 changed files with 27,350 additions and 30,978 deletions.
21 changes: 21 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# NOTE: This file and .prettierignore must contain same paths.

/.cache
/art
/coverage
/node/lib
/node/src/fbs
/rust
/target
/worker/deps
/worker/fbs
/worker/fuzzer
/worker/include
/worker/prebuild
/worker/pip_invoke
/worker/src
/worker/subprojects
/worker/test
/worker/out
/NO_GIT

178 changes: 178 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
const eslintConfig = {
env: {
es6: true,
node: true,
},
plugins: ['prettier'],
settings: {},
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
ecmaFeatures: {
impliedStrict: true,
},
lib: ['es2022'],
},
globals: {
NodeJS: 'readonly',
},
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
rules: {
'prettier/prettier': 2,
'constructor-super': 2,
curly: [2, 'all'],
// Unfortunatelly `curly` does not apply to blocks in `switch` cases so
// this is needed.
'no-restricted-syntax': [
2,
{
selector: 'SwitchCase > *.consequent[type!="BlockStatement"]',
message: 'Switch cases without blocks are disallowed',
},
],
'guard-for-in': 2,
'newline-after-var': 2,
'newline-before-return': 2,
'no-alert': 2,
'no-caller': 2,
'no-case-declarations': 2,
'no-catch-shadow': 2,
'no-class-assign': 2,
'no-console': 2,
'no-const-assign': 2,
'no-debugger': 2,
'no-dupe-args': 2,
'no-dupe-keys': 2,
'no-duplicate-case': 2,
'no-div-regex': 2,
'no-empty': [2, { allowEmptyCatch: true }],
'no-empty-pattern': 2,
'no-else-return': 0,
'no-eval': 2,
'no-extend-native': 2,
'no-ex-assign': 2,
'no-extra-bind': 2,
'no-extra-boolean-cast': 2,
'no-extra-label': 2,
'no-fallthrough': 2,
'no-func-assign': 2,
'no-global-assign': 2,
'no-implicit-coercion': 2,
'no-implicit-globals': 2,
'no-inner-declarations': 2,
'no-invalid-regexp': 2,
'no-invalid-this': 2,
'no-irregular-whitespace': 2,
'no-lonely-if': 2,
'no-multi-str': 2,
'no-native-reassign': 2,
'no-negated-in-lhs': 2,
'no-new': 2,
'no-new-func': 2,
'no-new-wrappers': 2,
'no-obj-calls': 2,
'no-proto': 2,
'no-prototype-builtins': 0,
'no-redeclare': 2,
'no-regex-spaces': 2,
'no-restricted-imports': 2,
'no-return-assign': 2,
'no-self-assign': 2,
'no-self-compare': 2,
'no-sequences': 2,
'no-shadow': 2,
'no-shadow-restricted-names': 2,
'no-sparse-arrays': 2,
'no-this-before-super': 2,
'no-throw-literal': 2,
'no-undef': 2,
'no-unmodified-loop-condition': 2,
'no-unreachable': 2,
'no-unused-vars': [1, { vars: 'all', args: 'after-used' }],
'no-use-before-define': 0,
'no-useless-call': 2,
'no-useless-computed-key': 2,
'no-useless-concat': 2,
'no-useless-rename': 2,
'no-var': 2,
'object-curly-newline': 0,
'prefer-const': 2,
'prefer-rest-params': 2,
'prefer-spread': 2,
'prefer-template': 2,
'spaced-comment': [2, 'always'],
strict: 2,
'valid-typeof': 2,
yoda: 2,
},
overrides: [],
};

const tsRules = {
'no-unused-vars': 0,
'@typescript-eslint/ban-types': 0,
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/semi': 2,
'@typescript-eslint/member-delimiter-style': [
2,
{
multiline: { delimiter: 'semi', requireLast: true },
singleline: { delimiter: 'semi', requireLast: false },
},
],
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-unused-vars': [
2,
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: false,
},
],
'@typescript-eslint/no-use-before-define': [2, { functions: false }],
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/no-non-null-assertion': 0,
};

eslintConfig.overrides.push({
files: ['*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
...eslintConfig.parserOptions,
project: 'node/tsconfig.json',
},
plugins: [...eslintConfig.plugins, '@typescript-eslint'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
...eslintConfig.extends,
],
rules: { ...eslintConfig.rules, ...tsRules },
});

eslintConfig.overrides.push({
files: ['node/src/test/*.ts'],
parserOptions: {
...eslintConfig.parserOptions,
project: 'node/tsconfig.json',
},
env: {
...eslintConfig.env,
'jest/globals': true,
},
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
...eslintConfig.extends,
],
plugins: [...eslintConfig.plugins, '@typescript-eslint', 'jest'],
rules: {
...eslintConfig.rules,
...tsRules,
'jest/no-disabled-tests': 2,
},
});

module.exports = eslintConfig;
73 changes: 0 additions & 73 deletions .github/CONTRIBUTING.md

This file was deleted.

2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/Bug_Report.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ If you got a crash in mediasoup, please try to provide a core dump into the issu

https://mediasoup.org/support/#crashes-in-mediasoup-get-a-core-dump


### Your environment

- Operating system:
Expand All @@ -26,5 +25,4 @@ https://mediasoup.org/support/#crashes-in-mediasoup-get-a-core-dump
- mediasoup version:
- mediasoup-client version:


### Issue description
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Support_Question.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ https://mediasoup.discourse.group

Before asking any questions, please check the mediasoup official documentation:

https://mediasoup.org/documentation/
https://mediasoup.org/documentation
79 changes: 44 additions & 35 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
actions: read
contents: read
Expand All @@ -31,49 +32,57 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'javascript', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
language: ['c-cpp', 'javascript-typescript', 'python']
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both.
# Use only 'javascript-typescript' to analyze code written in JavaScript,
# TypeScript or both.
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support.

env:
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD: 'true'
MEDIASOUP_LOCAL_DEV: 'true'

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a
# config file. By default, queries listed here will override any
# specified in a config file. Prefix the list here with "+" to use
# these queries and those in the config file.
#
# Details on CodeQL's query packs refer to:
# https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# We need to install pip invoke library.
- name: pip3 install invoke
run: pip3 install invoke

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# If the Autobuild fails above, remove it and uncomment the following
# three lines. Modify them (or add more) to build your code if your
# project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: '/language:${{matrix.language}}'
# Use npm ci to build mediasoup Node and worker instead of relying on
# Autobuild.
- name: npm ci
run: npm ci --foreground-scripts

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: '/language:${{matrix.language}}'
Loading

0 comments on commit e027f54

Please sign in to comment.