Skip to content

Commit

Permalink
Feature/cmcd v2 fixes (#28)
Browse files Browse the repository at this point in the history
fix: fixed autoplay mpd calculation and version moved to top level cmcd config
  • Loading branch information
JoaquinBCh authored Nov 8, 2024
1 parent d988338 commit fbb9b30
Show file tree
Hide file tree
Showing 45 changed files with 2,746 additions and 970 deletions.
59 changes: 0 additions & 59 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "18.x"
node-version: "20.x"
- name: Install dependencies
run: npm install
- name: Run build
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/verify_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,17 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'latest'
node-version: '20'
cache: 'npm'
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
path: node_modules
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
Expand All @@ -37,4 +32,3 @@ jobs:
- run: npm run lint
- run: npm run test
- run: npm run webpack-build

25 changes: 10 additions & 15 deletions .github/workflows/verify_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,17 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 'latest'
node-version: '20'
cache: 'npm'
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
path: node_modules
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
Expand All @@ -64,20 +59,20 @@ jobs:
git config --global user.email "[email protected]"
git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-branch
git merge pr-branch --no-ff
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
path: node_modules
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
Expand Down
1 change: 0 additions & 1 deletion build/webpack.base.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const commonConfig = {
{
loader: 'babel-loader',
options: {
targets: 'defaults',
presets: ['@babel/preset-env']
},
},
Expand Down
33 changes: 14 additions & 19 deletions build/webpack.prod.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { merge } = require('webpack-merge');
const ESLintPlugin = require('eslint-webpack-plugin');
const EsLintWebpackPlugin = require('eslint-webpack-plugin');
const { umdConfig, esmConfig } = require('./webpack.base.cjs');

const entries = {
Expand All @@ -19,22 +19,25 @@ const configDevUmd = merge(umdConfig, {
}
});

const plugins = [
new EsLintWebpackPlugin({
configType: 'flat',
files: [
'src/**/*.js',
'test/unit/mocks/*.js',
'test/unit/test/**/*.js'
]
})
]

const configProdUmd = merge(umdConfig, {
mode: 'production',
entry: entries,
output: {
filename: '[name].min.js'
},
performance: { hints: false },
plugins: [
new ESLintPlugin({
files: [
'src/**/*.js',
'test/unit/mocks/*.js',
'test/unit/test/**/*.js'
]
})
]
plugins
});

const configDevEsm = merge(esmConfig, {
Expand All @@ -55,15 +58,7 @@ const configProdEsm = merge(esmConfig, {
usedExports: false,
},
performance: { hints: false },
plugins: [
new ESLintPlugin({
files: [
'src/**/*.js',
'test/unit/mocks/*.js',
'test/unit/test/**/*.js'
]
})
]
plugins
});

module.exports = [configDevUmd, configProdUmd, configDevEsm, configProdEsm];
64 changes: 64 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import globals from 'globals';

export default [{
languageOptions: {
globals: {
...globals.browser,
...globals.mocha,
...globals.node,
dashjs: true,
ManagedMediaSource: true,
WebKitMediaSource: true,
MediaSource: true,
WebKitMediaKeys: true,
MSMediaKeys: true,
MediaKeys: true,
google: true,
},

ecmaVersion: 2020,
sourceType: 'module',

parserOptions: {
parser: '@babel/eslint-parser',
requireConfigFile: false,
},
},

rules: {
'no-caller': 2,
'no-undef': 2,
'no-unused-vars': [
'error',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: true,
caughtErrors: 'none' // Allow unused variables in catch blocks
}
],
'no-use-before-define': 0,
strict: 0,
'no-loop-func': 0,
'no-multi-spaces': 'error',

'keyword-spacing': ['error', {
before: true,
after: true,
}],

quotes: ['error', 'single', {
allowTemplateLiterals: true,
}],

indent: ['error', 4, {
SwitchCase: 1,
}],

curly: ['error', 'all'],

'space-infix-ops': ['error', {
int32Hint: true,
}],
},
}];
Loading

0 comments on commit fbb9b30

Please sign in to comment.