Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Dependencies #45

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ node_modules/
dist/
docs/api/
test/dist/

# Build-related files
.eslintcache
*.html
19,756 changes: 11,813 additions & 7,943 deletions package-lock.json

Large diffs are not rendered by default.

85 changes: 45 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "videojs-vtt-thumbnails",
"version": "0.0.13",
"version": "0.1.0",
"description": "Display thumnails on progress bar hover, driven by external VTT files.",
"main": "dist/videojs-vtt-thumbnails.cjs.js",
"module": "dist/videojs-vtt-thumbnails.es.js",
Expand All @@ -19,13 +19,14 @@
"build": "npm-run-all -p build:*",
"build:css": "npm-run-all build:css:sass build:css:bannerize",
"build:css:bannerize": "bannerize dist/videojs-vtt-thumbnails.css --banner=scripts/banner.ejs",
"build:css:sass": "node-sass src/plugin.scss dist/videojs-vtt-thumbnails.css --output-style=compressed --linefeed=lf",
"build:css:sass": "sass src/plugin.scss dist/videojs-vtt-thumbnails.css --style=compressed --no-source-map",
"build:js": "npm-run-all build:js:rollup-modules build:js:rollup-umd build:js:bannerize build:js:uglify",
"build:js:bannerize": "bannerize dist/videojs-vtt-thumbnails.js --banner=scripts/banner.ejs",
"build:js:rollup-modules": "rollup -c scripts/modules.rollup.config.js",
"build:js:rollup-umd": "rollup -c scripts/umd.rollup.config.js",
"build:js:rollup-modules": "rollup -c scripts/modules.rollup.config.mjs",
"build:js:rollup-umd": "rollup -c scripts/umd.rollup.config.mjs",
"build:js:uglify": "uglifyjs dist/videojs-vtt-thumbnails.js --comments --mangle --compress -o dist/videojs-vtt-thumbnails.min.js",
"build:test": "rollup -c scripts/test.rollup.config.js",
"build:test": "rollup -c scripts/test.rollup.config.mjs",
"analyze": "ANALYZE=true rollup -c scripts/modules.rollup.config.mjs",
"clean": "rimraf dist test/dist",
"postclean": "mkdirp dist test/dist",
"docs": "npm-run-all docs:*",
Expand All @@ -40,10 +41,10 @@
"version": "node scripts/version.js",
"watch": "npm-run-all -p watch:*",
"watch:css": "npm-run-all build:css:sass watch:css:sass",
"watch:css:sass": "node-sass src/plugin.scss dist/videojs-vtt-thumbnails.css --output-style=compressed --linefeed=lf --watch src/**/*.scss",
"watch:js-modules": "rollup -c scripts/modules.rollup.config.js -w",
"watch:js-umd": "rollup -c scripts/umd.rollup.config.js -w",
"watch:test": "rollup -c scripts/test.rollup.config.js -w",
"watch:css:sass": "sass src/plugin.scss dist/videojs-vtt-thumbnails.css --style=compressed --no-source-map --watch",
"watch:js-modules": "rollup -c scripts/modules.rollup.config.mjs -w",
"watch:js-umd": "rollup -c scripts/umd.rollup.config.mjs -w",
"watch:test": "rollup -c scripts/test.rollup.config.mjs -w",
"prepublishOnly": "npm run build",
"prepush": "npm run lint",
"precommit": "npm run docs:toc && git add README.md"
Expand Down Expand Up @@ -72,44 +73,48 @@
"test/"
],
"dependencies": {
"global": "^4.4.0",
"request": "^2.88.2",
"video.js": "^7.2.0 || ^6.6.0"
"global": "^4.4.0"
},
"devDependencies": {
"@babel/core": "^7.9.6",
"@babel/plugin-transform-object-assign": "^7.8.3",
"@babel/preset-env": "^7.9.6",
"@rollup/plugin-babel": "^5.0.2",
"@rollup/plugin-commonjs": "^12.0.0",
"@rollup/plugin-json": "^4.0.3",
"@rollup/plugin-multi-entry": "^3.0.1",
"@rollup/plugin-node-resolve": "^8.0.0",
"@babel/core": "^7.26.0",
"@babel/plugin-transform-object-assign": "^7.25.9",
"@babel/preset-env": "^7.26.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-multi-entry": "^6.0.1",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-terser": "^0.4.4",
"bannerize": "^1.1.4",
"conventional-changelog-cli": "^1.3.1",
"conventional-changelog-videojs": "^3.0.0",
"doctoc": "^1.4.0",
"eslint": "^7.0.0",
"husky": "^0.13.3",
"jsdoc": "^3.6.4",
"karma": "^1.7.0",
"karma-chrome-launcher": "^2.1.1",
"conventional-changelog-cli": "^5.0.0",
"conventional-changelog-videojs": "^3.0.2",
"doctoc": "^2.2.1",
"eslint": "^7.32.0",
"husky": "^9.1.7",
"jsdoc": "^4.0.4",
"karma": "^6.4.4",
"karma-chrome-launcher": "^3.2.0",
"karma-detect-browsers": "^2.3.3",
"karma-firefox-launcher": "^1.3.0",
"karma-firefox-launcher": "^2.1.3",
"karma-ie-launcher": "^1.0.0",
"karma-qunit": "^1.2.1",
"karma-qunit": "^4.2.1",
"karma-safari-launcher": "^1.0.0",
"mkdirp": "^0.5.5",
"node-sass": "^4.14.1",
"mkdirp": "^3.0.1",
"node-static": "^0.7.11",
"npm-run-all": "^4.1.5",
"qunitjs": "^2.3.2",
"rimraf": "^2.7.1",
"rollup": "^2.10.7",
"rollup-watch": "^3.2.2",
"semver": "^5.7.1",
"sinon": "^2.2.0",
"uglify-js": "^3.9.3",
"videojs-standard": "^6.0.6"
"qunitjs": "^2.4.1",
"request": "^2.88.2",
"rimraf": "^6.0.1",
"rollup": "^4.27.3",
"rollup-plugin-visualizer": "^5.12.0",
"rollup-watch": "^4.3.1",
"sass": "^1.81.0",
"semver": "^7.6.3",
"sinon": "^19.0.2",
"uglify-js": "^3.19.3",
"videojs-standard": "^9.1.0"
},
"peerDependencies": {
"video.js": "^7.2.0 || ^6.6.0 || ^8.19.0"
}
}
50 changes: 0 additions & 50 deletions scripts/modules.rollup.config.js

This file was deleted.

66 changes: 66 additions & 0 deletions scripts/modules.rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import babel from '@rollup/plugin-babel';
import json from '@rollup/plugin-json';
import terser from '@rollup/plugin-terser';
import { visualizer } from 'rollup-plugin-visualizer';

// Determine if ANALYZE is enabled
const analyzing = process.env.ANALYZE === 'true';

export default {
input: 'src/plugin.js',
output: [{
name: 'videojsVttThumbnails',
file: 'dist/videojs-vtt-thumbnails.cjs.js',
format: 'cjs',
globals: {
'video.js': 'videojs'
}
}, {
name: 'videojsVttThumbnails',
file: 'dist/videojs-vtt-thumbnails.es.js',
format: 'es',
globals: {
'video.js': 'videojs'
}
}, {
name: 'videojsVttThumbnails',
file: 'dist/videojs-vtt-thumbnails.min.js',
format: 'iife',
plugins: [terser()], // Minifies the output
globals: {
'video.js': 'videojs'
}
}],
external: [
'global',
'global/document',
'global/window',
'video.js'
],
plugins: [
json(),
babel({
babelrc: false,
exclude: 'node_modules/**',
babelHelpers: 'bundled',
presets: [
['@babel/preset-env', { modules: false }]
]
}),
...(analyzing ? [
visualizer({
filename: 'bundle-stats.html',
brotliSize: true,
gzipSize: true,
open: true,
}),
] : []),
],
onwarn(warning, warn) {
if (warning.code === 'UNRESOLVED_IMPORT') {
console.warn(`Unresolved import: ${warning.source}`);
} else {
warn(warning);
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default {
babel({
babelrc: false,
exclude: 'node_modules/**',
babelHelpers: 'bundled',
presets: [
['@babel/preset-env', {
loose: true,
Expand Down
49 changes: 0 additions & 49 deletions scripts/umd.rollup.config.js

This file was deleted.

73 changes: 73 additions & 0 deletions scripts/umd.rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import babel from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import resolve from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
import { visualizer } from 'rollup-plugin-visualizer';

// Determine if ANALYZE is enabled
const analyzing = process.env.ANALYZE === 'true';

export default {
input: 'src/plugin.js',
output: [
{
name: 'videojsVttThumbnails',
file: 'dist/videojs-vtt-thumbnails.js',
format: 'umd',
globals: {
'video.js': 'videojs'
}
},
{
name: 'videojsVttThumbnails',
file: 'dist/videojs-vtt-thumbnails.min.js',
format: 'umd',
plugins: [terser()], // Minifies this build
globals: {
'video.js': 'videojs'
}
}
],
external: [
'video.js'
],
plugins: [
resolve({
browser: true // Resolve browser-specific modules
}),
json(),
commonjs({
sourceMap: false // Avoid generating sourcemaps for CommonJS modules
}),
babel({
babelrc: false,
exclude: 'node_modules/**',
babelHelpers: 'bundled',
presets: [
['@babel/preset-env', {
loose: true,
modules: false
}]
],
plugins: [
'@babel/transform-object-assign'
]
}),
...(analyzing ? [
visualizer({
filename: 'bundle-stats.html',
brotliSize: true,
gzipSize: true,
open: true,
}),
] : []),
],
onwarn(warning, warn) {
if (warning.code === 'UNRESOLVED_IMPORT') {
console.warn(`Unresolved import: ${warning.source}`);
} else {
warn(warning);
}
}
};
4 changes: 3 additions & 1 deletion src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ const onPlayerReady = (player, options) => {
*/
const vttThumbnails = function(options) {
this.ready(() => {
onPlayerReady(this, videojs.mergeOptions(defaults, options));
const mergeOptions = 'obj' in videojs ? videojs.obj.merge : (videojs.mergeOptions || videojs.util.mergeOptions);

onPlayerReady(this, mergeOptions(defaults, options));
});
};

Expand Down