Skip to content

Commit

Permalink
feat(FEC-10290): upgrade NPM packages (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Ziv authored Jul 26, 2020
1 parent 7a28b2f commit 5487625
Show file tree
Hide file tree
Showing 11 changed files with 5,432 additions and 3,897 deletions.
23 changes: 12 additions & 11 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"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"
],
"presets": ["@babel/preset-env", "@babel/preset-flow"]
}
1 change: 0 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
[libs]
node_modules/@playkit-js/playkit-js/flow-typed/
[options]
unsafe.enable_getters_and_setters=true
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ CHANGELOG.md
yarn.lock
yarn-error.log
LICENSE
coverage
126 changes: 63 additions & 63 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 All @@ -13,75 +13,75 @@ services:
cache:
yarn: true
directories:
- node_modules
- node_modules

before_install:
- export DISPLAY=:99.0
- chmod +x ./scripts/travis.sh
- export DISPLAY=:99.0
- chmod +x ./scripts/travis.sh

script: ./scripts/travis.sh

stages:
- Tests
- Release canary
- Release
- Tests
- Release canary
- Release

jobs:
fast_finish: true
include:
# https://docs.travis-ci.com/user/build-stages/deploy-github-releases/
- stage: Release
name: "Releasing a new version"
if: tag IS present
env: TRAVIS_MODE=release
deploy:
- provider: releases
api_key: $GH_TOKEN
file_glob: true
file: dist/*
prerelease: true
skip_cleanup: true
on:
branch: master
tags: true
- provider: npm
api_key: $NPM_TOKEN
email: $NPM_EMAIL
skip_cleanup: true
on:
tags: true
branch: master
after_deploy:
- chmod +x ./scripts/after_deploy.sh
- ./scripts/after_deploy.sh "flash" "$TRAVIS_TAG" "$JENKINS_TAG_TOKEN"
# publish canary package if on master
- stage: Release canary
if: (branch = master) AND (type != pull_request) AND commit_message !~ /^chore\(release\)/
env: TRAVIS_MODE=releaseCanary
deploy:
provider: npm
api_key: $NPM_TOKEN
email: $NPM_EMAIL
skip_cleanup: true
tag: canary
on:
tags: false
branch: master
after_deploy:
- currentVersion=$(npx -c 'echo "$npm_package_version"')
- echo $currentVersion
- chmod +x ./scripts/after_deploy.sh
- ./scripts/after_deploy.sh "flash" "$currentVersion" "$JENKINS_CANARY_TOKEN"
# Required tests
- stage: Tests
if: (branch = master) OR (tag IS present) OR (type = pull_request)
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
- stage: Tests
if: (branch = master) OR (tag IS present) OR (type = pull_request)
name: "Running unit tests"
env: TRAVIS_MODE=unitTests
# https://docs.travis-ci.com/user/build-stages/deploy-github-releases/
- stage: Release
name: 'Releasing a new version'
if: tag IS present
env: TRAVIS_MODE=release
deploy:
- provider: releases
api_key: $GH_TOKEN
file_glob: true
file: dist/*
prerelease: true
skip_cleanup: true
on:
branch: master
tags: true
- provider: npm
api_key: $NPM_TOKEN
email: $NPM_EMAIL
skip_cleanup: true
on:
tags: true
branch: master
after_deploy:
- chmod +x ./scripts/after_deploy.sh
- ./scripts/after_deploy.sh "flash" "$TRAVIS_TAG" "$JENKINS_TAG_TOKEN"
# publish canary package if on master
- stage: Release canary
if: (branch = master) AND (type != pull_request) AND commit_message !~ /^chore\(release\)/
env: TRAVIS_MODE=releaseCanary
deploy:
provider: npm
api_key: $NPM_TOKEN
email: $NPM_EMAIL
skip_cleanup: true
tag: canary
on:
tags: false
branch: master
after_deploy:
- currentVersion=$(npx -c 'echo "$npm_package_version"')
- echo $currentVersion
- chmod +x ./scripts/after_deploy.sh
- ./scripts/after_deploy.sh "flash" "$currentVersion" "$JENKINS_CANARY_TOKEN"
# Required tests
- stage: Tests
if: (branch = master) OR (tag IS present) OR (type = pull_request)
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
- stage: Tests
if: (branch = master) OR (tag IS present) OR (type = pull_request)
name: 'Running unit tests'
env: TRAVIS_MODE=unitTests
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[![](https://img.shields.io/npm/v/@playkit-js/playkit-js-flash/latest.svg)](https://www.npmjs.com/package/@playkit-js/playkit-js-fkash)
[![](https://img.shields.io/npm/v/@playkit-js/playkit-js-flash/canary.svg)](https://www.npmjs.com/package/@playkit-js/playkit-js-flash/v/canary)


PlayKit JS Flash adapter integrates [FLASH.HLS] with the [PlayKit JS Player].

PlayKit JS Flash is written in [ECMAScript6], statically analysed using [Flow] and transpiled in ECMAScript5 using [Babel].
Expand Down Expand Up @@ -55,11 +54,11 @@ Finally, add the bundle as a script tag in your page, and initialize the player
<script type="text/javascript" src="/PATH/TO/FILE/playkit-js-flash.js"></script>
<div id="player-placeholder"" style="height:360px; width:640px">
<script type="text/javascript">
var playerContainer = document.querySelector("#player-placeholder");
var config = {...};
var player = playkit.core.loadPlayer(config);
playerContainer.appendChild(player.getView());
player.play();
var playerContainer = document.querySelector("#player-placeholder");
var config = {...};
var player = playkit.core.loadPlayer(config);
playerContainer.appendChild(player.getView());
player.play();
</script>
```
Expand Down
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const customLaunchers = {
}
};

module.exports = function(config) {
module.exports = function (config) {
let karmaConf = {
logLevel: config.LOG_INFO,
browsers: ['Chrome', 'Firefox'],
Expand Down
96 changes: 50 additions & 46 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
"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",
"watch": "webpack --progress --colors --watch --mode development",
"test": "NODE_ENV=test karma start --color --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"
"precommit": "lint-staged",
"prettier:fix": "prettier --write ."
},
"lint-staged": {
"*.{js,jsx}": [
Expand All @@ -30,56 +31,59 @@
"access": "public"
},
"devDependencies": {
"@playkit-js/playkit-js": "^0.41.0",
"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",
"cross-env": "^3.1.4",
"css-loader": "^0.28.4",
"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.2",
"flow-bin": "^0.43.1",
"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",
"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",
"prettier": "^1.13.7",
"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",
"val-loader": "^1.1.0",
"webpack": "3.6.0",
"webpack-dev-server": "2.5.0"
"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.41.0"
"@playkit-js/playkit-js": "0.62.1-canary.724715e"
},
"keywords": [
"kaltura",
Expand Down
8 changes: 4 additions & 4 deletions src/flashhls-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class FlashHLSAdapter extends FakeEventTarget {

// Convert flash vars to string
if (flashVars) {
Object.getOwnPropertyNames(flashVars).forEach(function(key) {
Object.getOwnPropertyNames(flashVars).forEach(function (key) {
flashVarsString += `${key}=${flashVars[key]}&amp;`;
});
}
Expand All @@ -66,7 +66,7 @@ class FlashHLSAdapter extends FakeEventTarget {
);

// Create param tags string
Object.getOwnPropertyNames(params).forEach(function(key) {
Object.getOwnPropertyNames(params).forEach(function (key) {
paramsString += `<param name="${key}" value="${params[key]}" />`;
});

Expand All @@ -83,7 +83,7 @@ class FlashHLSAdapter extends FakeEventTarget {
);

// Create Attributes string
Object.getOwnPropertyNames(attributes).forEach(function(key) {
Object.getOwnPropertyNames(attributes).forEach(function (key) {
attrsString += `${key}="${attributes[key]}" `;
});

Expand Down Expand Up @@ -249,7 +249,7 @@ class FlashHLSAdapter extends FakeEventTarget {
};
// Create a single global callback function and pass it's name
// to the SWF with the name `callback` in the FlashVars parameter.
window.flashlsCallback = function(eventName, args) {
window.flashlsCallback = function (eventName, args) {
if (flashlsEvents[eventName]) {
flashlsEvents[eventName].apply(null, args);
}
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import {Flash} from './flash';
declare var __VERSION__: string;
declare var __NAME__: string;

const VERSION = __VERSION__;
const NAME = __NAME__;

export {Flash as Engine};
export {__VERSION__ as VERSION, __NAME__ as NAME};
export {VERSION, NAME};

if (Flash.isSupported()) {
registerEngine(Flash.id, Flash);
Expand Down
Loading

0 comments on commit 5487625

Please sign in to comment.