Skip to content

Commit

Permalink
feat(FEC-10290): upgrade NPM packages (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Ziv authored Jul 27, 2020
1 parent a237449 commit d2d6388
Show file tree
Hide file tree
Showing 20 changed files with 5,607 additions and 5,784 deletions.
28 changes: 17 additions & 11 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
{
"presets": [
"es2015"
],
"plugins": [
"transform-flow-strip-types",
"transform-class-properties"
],
"env": {
"test": {
"plugins": [
"istanbul"
]
"plugins": ["istanbul"]
}
}
},
"ignore": ["node_modules/**/*"],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-flow-strip-types",
"@babel/plugin-transform-property-mutators",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-class-properties",
[
"@babel/plugin-transform-classes",
{
"loose": true
}
]
],
"presets": ["@babel/preset-env", "@babel/preset-flow"]
}
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/flow-typed/**/*.js
/coverage
/dist
karma.conf.js
webpack.config.js
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"should": true,
"sinon": true,
"__VERSION__": true,
"__NAME__": true
"__NAME__": true,
"process": true,
"__dirname": true
},
"rules": {
"prettier/prettier": "error",
Expand Down
1 change: 0 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
node_modules/@playkit-js/playkit-js/flow-typed/
node_modules/playkit-js-providers/flow-typed/
[options]
unsafe.enable_getters_and_setters=true
20 changes: 13 additions & 7 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
<!-- If you are raising a bug playing a stream, you must fill out the following or your issue may not be responded to. For features or improvements, you may delete this. -->

##### Prerequisites
- [ ] Have you checked for duplicate [issues](https://github.com/kaltura/playkit-js/issues): ______
- [ ] Which Player [version](https://github.com/kaltura/playkit-js/releases) are you using: ______
- [ ] Can you reproduce the issue with our latest release version: ______
- [ ] Can you reproduce the issue with the latest code from master: ______
- [ ] What browser and OS names and versions are you using: ______
- [ ] If applicable, add test code or test page to reproduce:

- [ ] Have you checked for duplicate [issues](https://github.com/kaltura/playkit-js/issues): **\_\_**
- [ ] Which Player [version](https://github.com/kaltura/playkit-js/releases) are you using: **\_\_**
- [ ] Can you reproduce the issue with our latest release version: **\_\_**
- [ ] Can you reproduce the issue with the latest code from master: **\_\_**
- [ ] What browser and OS names and versions are you using: **\_\_**
- [ ] If applicable, add test code or test page to reproduce:

```
Paste test code here
```

##### Expected behavior

What you expected to happen

##### Actual behavior

What actually happened

##### Console output

```
Paste the contents of the browser console here.
```

```
For media errors reported on Chrome browser, please also paste the output of chrome://media-internals
For media errors reported on Chrome browser, please also paste the output of chrome://media-internals
```
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ If the PR is related to an open issue please link to it.

- [ ] changes have been done against master branch, and PR does not conflict
- [ ] new unit / functional tests have been added (whenever applicable)
- [ ] test are passing in local environment
- [ ] test are passing in local environment
- [ ] Travis tests are passing (or test results are not worse than on master branch :))
- [ ] Docs have been updated
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
yarn.lock
CHANGELOG.md
LICENSE
coverage
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sudo: required
dist: xenial
language: node_js
node_js:
- "node"
- 'node'

addons:
chrome: stable
Expand Down Expand Up @@ -31,7 +31,7 @@ jobs:
include:
# https://docs.travis-ci.com/user/build-stages/deploy-github-releases/
- stage: Release
name: "Releasing a new version"
name: 'Releasing a new version'
if: tag IS present
env: TRAVIS_MODE=release
deploy:
Expand Down Expand Up @@ -77,13 +77,13 @@ jobs:
# Required tests
- stage: Tests
if: (branch = master) OR (tag IS present) OR (type = pull_request)
name: "Running lint"
env: TRAVIS_MODE=lint
name: 'Running lint'
env: TRAVIS_MODE=lint
- stage: Tests
if: (branch = master) OR (tag IS present) OR (type = pull_request)
name: "Running Flow type check"
env: TRAVIS_MODE=flow
name: 'Running Flow type check'
env: TRAVIS_MODE=flow
- stage: Tests
if: (branch = master) OR (tag IS present) OR (type = pull_request)
name: "Running unit tests"
env: TRAVIS_MODE=unitTests
name: 'Running unit tests'
env: TRAVIS_MODE=unitTests
41 changes: 21 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,28 @@ Finally, add the bundle as a script tag in your page, and initialize the player
<script type="text/javascript" src="/PATH/TO/FILE/kaltura-{ovp/tv}-player.js"></script>
<script type="text/javascript" src="/PATH/TO/FILE/playkit-kava.js"></script>
<div id="player-placeholder" style="height:360px; width:640px">
<script type="text/javascript">
var config = {
targetId: 'player-placeholder',
provider: {
partnerId: {PARTNER_ID}
...
},
plugins: {
kava: {
<script type="text/javascript">
var config = {
targetId: 'player-placeholder',
provider: {
partnerId: {PARTNER_ID}
...
},
plugins: {
kava: {
...
}
...
}
...
}
...
};
var player = KalturaPlayer.setup(config);
player.loadMedia({
entryId: '{ENTRY_ID}'
...
});
</script>
}
...
};
var player = KalturaPlayer.setup(config);
player.loadMedia({
entryId: '{ENTRY_ID}'
...
});
</script>
</div>
```

## Documentation
Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
theme: jekyll-theme-cayman
theme: jekyll-theme-cayman
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const launchers = {
}
};

module.exports = function(config) {
module.exports = function (config) {
let karmaConf = {
logLevel: config.LOG_INFO,
browsers: ['Chrome_browser'],
Expand Down
103 changes: 53 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
"scripts": {
"clean": "rm -rf ./dist",
"prebuild": "npm run clean",
"build": "NODE_ENV=production webpack",
"dev": "webpack-dev-server",
"watch": "webpack --progress --colors --watch",
"test": "NODE_ENV=test karma start --color",
"build": "webpack --mode production",
"dev": "webpack-dev-server --mode development",
"test": "NODE_ENV=test karma start --color --mode development",
"watch": "webpack --progress --colors --watch --mode development",
"release": "standard-version",
"pushTaggedRelease": "git push --follow-tags --no-verify origin master",
"eslint": "eslint . --color",
"flow": "flow check",
"commit:dist": "git add --force --all dist && (git commit -m 'chore: update dist' || exit 0)",
"precommit": "lint-staged",
"docs:generate": "documentation build flow-typed/** src/** -f md -o docs/configuration-api.md",
"docs:serve": "documentation serve flow-typed/** src/** --watch"
"docs:serve": "documentation serve flow-typed/** src/** --watch",
"prettier:fix": "prettier --write ."
},
"lint-staged": {
"*.{js,jsx}": [
Expand All @@ -32,60 +33,62 @@
"access": "public"
},
"devDependencies": {
"@playkit-js/playkit-js": "^0.59.5",
"babel-cli": "^6.18.0",
"babel-core": "^6.18.2",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.2.7",
"babel-plugin-istanbul": "^4.0.0",
"babel-plugin-transform-class-properties": "^6.22.0",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-preset-es2015": "^6.18.0",
"babel-register": "^6.23.0",
"chai": "^3.5.0",
"copy-webpack-plugin": "^4.3.1",
"cross-env": "^3.1.4",
"css-loader": "^0.28.4",
"documentation": "^8.1.2",
"eslint": "^3.10.0",
"eslint-config-prettier": "^2.9.0",
"eslint-loader": "^1.6.1",
"eslint-plugin-flowtype": "^2.30.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-mocha-no-only": "^0.0.5",
"eslint-plugin-prettier": "^2.6.0",
"flow-bin": "latest",
"husky": "^0.14.3",
"@babel/cli": "^7.10.5",
"@babel/core": "^7.10.5",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-proposal-object-rest-spread": "^7.10.4",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-classes": "^7.10.4",
"@babel/plugin-transform-flow-strip-types": "^7.10.4",
"@babel/plugin-transform-property-mutators": "^7.10.4",
"@babel/preset-env": "^7.10.4",
"@babel/preset-flow": "^7.10.4",
"@babel/register": "^7.10.5",
"@playkit-js/playkit-js": "0.62.1-canary.724715e",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"babel-plugin-istanbul": "^6.0.0",
"chai": "^4.2.0",
"copy-webpack-plugin": "^6.0.3",
"cross-env": "^7.0.2",
"eslint": "^7.4.0",
"eslint-config-prettier": "^6.11.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-mocha-no-only": "^1.1.0",
"eslint-plugin-prettier": "^3.1.4",
"flow-bin": "^0.129.0",
"husky": "^4.2.5",
"istanbul": "^0.4.5",
"karma": "^1.5.0",
"karma": "^5.1.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-coverage": "^1.1.1",
"karma-firefox-launcher": "^1.0.1",
"karma-chrome-launcher": "^3.1.0",
"karma-cli": "^2.0.0",
"karma-coverage": "^2.0.2",
"karma-firefox-launcher": "^1.3.0",
"karma-ie-launcher": "^1.0.0",
"karma-mocha": "^1.3.0",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-safari-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.2",
"lint-staged": "^7.2.0",
"mocha": "^3.2.0",
"karma-webpack": "^4.0.2",
"lint-staged": "^10.2.11",
"mocha": "^8.0.1",
"mocha-cli": "^1.0.1",
"playkit-js-providers": "https://github.com/kaltura/playkit-js-providers.git#master",
"pre-push": "^0.1.1",
"prettier": "^1.13.5",
"sinon": "^2.0.0",
"sinon-chai": "^2.8.0",
"standard-version": "^4.0.0",
"style-loader": "^0.18.2",
"uglifyjs-webpack-plugin": "^0.4.3",
"webpack": "latest",
"webpack-dev-server": "latest"
"playkit-js-providers": "https://github.com/kaltura/playkit-js-providers.git#update-dist",
"prettier": "^2.0.5",
"sinon": "^9.0.2",
"sinon-chai": "^3.5.0",
"standard-version": "^8.0.2",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
},
"peerDependencies": {
"@playkit-js/playkit-js": "^0.51.1",
"playkit-js-providers": "https://github.com/kaltura/playkit-js-providers.git#master"
"@playkit-js/playkit-js": "0.62.1-canary.724715e",
"playkit-js-providers": "https://github.com/kaltura/playkit-js-providers.git#update-dist"
},
"keywords": [
"kaltura",
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ import {Kava} from './kava';
declare var __VERSION__: string;
declare var __NAME__: string;

const VERSION = __VERSION__;
const NAME = __NAME__;

export {Kava as Plugin};
export {KavaEventType as EventType} from './kava-event-model';
export {__VERSION__ as VERSION, __NAME__ as NAME};
export {VERSION, NAME};

const pluginName: string = 'kava';

Expand Down
2 changes: 1 addition & 1 deletion src/kava-timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const SECOND: number = 1000;
class KavaTimer extends FakeEventTarget {
_resetCounter: number;
_eventCounter: number;
_intervalId: ?number;
_intervalId: ?IntervalID;
_stopped: boolean;
_config: Object;

Expand Down
9 changes: 5 additions & 4 deletions src/kava.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ class Kava extends BasePlugin {
return false;
}
}

_updateMaxNetworkConnectionOverhead(networkConnectionOverhead: number): void {
this._model.updateModel({
maxNetworkConnectionOverhead: Math.max(this._model.maxNetworkConnectionOverhead, networkConnectionOverhead)
Expand Down Expand Up @@ -777,11 +778,11 @@ class Kava extends BasePlugin {
this.logger.warn(`Kava analytics block report because of missing param ${missingParam}`);
}

static _getTimeDifferenceInSeconds(time): number {
static _getTimeDifferenceInSeconds(time: number): number {
return (Date.now() - time) / 1000.0;
}

_updateTabModeinModel(hiddenAttr: string): void {
_updateTabModeInModel(hiddenAttr: string): void {
this._model.updateModel({
// $FlowFixMe
tabMode: document[hiddenAttr] ? TabMode.TAB_NOT_FOCUSED : TabMode.TAB_FOCUSED
Expand All @@ -804,8 +805,8 @@ class Kava extends BasePlugin {
}

if (hiddenAttr && visibilityChangeEventName) {
this.eventManager.listen(document, visibilityChangeEventName, () => this._updateTabModeinModel(hiddenAttr));
this._updateTabModeinModel(hiddenAttr);
this.eventManager.listen(document, visibilityChangeEventName, () => this._updateTabModeInModel(hiddenAttr));
this._updateTabModeInModel(hiddenAttr);
}
}
}
Expand Down
Loading

0 comments on commit d2d6388

Please sign in to comment.