From 89234d0b2e053fb5aa22725c984460c9b290378f Mon Sep 17 00:00:00 2001 From: mister-ben <1676039+mister-ben@users.noreply.github.com> Date: Mon, 22 Jul 2024 00:37:21 +0200 Subject: [PATCH] fix(types): Add has|usingPlugin to typedef --- package-lock.json | 10 ---------- package.json | 1 - rollup.config.js | 32 ++++++++++++++++++++++++++++++-- src/js/component.js | 10 ++++++++++ src/js/player.js | 6 ++++-- 5 files changed, 44 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 44d3e56e1f..776008dd76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12402,16 +12402,6 @@ "chalk": "^2.4.2" } }, - "rollup-plugin-replace": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-replace/-/rollup-plugin-replace-2.2.0.tgz", - "integrity": "sha512-/5bxtUPkDHyBJAKketb4NfaeZjL5yLZdeUihSfbF2PQMz+rSTEb8ARKoOl3UBT4m7/X+QOXJo3sLTcq+yMMYTA==", - "dev": true, - "requires": { - "magic-string": "^0.25.2", - "rollup-pluginutils": "^2.6.0" - } - }, "rollup-plugin-stub": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/rollup-plugin-stub/-/rollup-plugin-stub-1.2.0.tgz", diff --git a/package.json b/package.json index a1fbe6a45f..5e06d8bdec 100644 --- a/package.json +++ b/package.json @@ -154,7 +154,6 @@ "rollup-plugin-multi-entry": "^2.0.2", "rollup-plugin-node-resolve": "^4.2.4", "rollup-plugin-progress": "^1.1.2", - "rollup-plugin-replace": "^2.2.0", "rollup-plugin-stub": "^1.2.0", "rollup-plugin-svg": "^2.0.0", "sass": "^1.34.0", diff --git a/rollup.config.js b/rollup.config.js index 18cdc6ffef..ca2f96ac49 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -17,7 +17,7 @@ import image from '@rollup/plugin-image'; import istanbul from 'rollup-plugin-istanbul'; import externalGlobals from 'rollup-plugin-external-globals'; import svg from 'rollup-plugin-svg'; -import { excludeLines } from './build/rollup-ignore'; +import excludeLines from './build/rollup-exclude-lines'; const excludeCoverage = [ 'test/**', @@ -145,7 +145,7 @@ export default cliargs => [ external: externals.browser, plugins: [ excludeLines({ - include: 'src/**', + include: 'src/js/**', patterns: [/\/\/\s*exclude\s*start[\s\S]*?\/\/\s*exclude\s*end/g] }), alias({ @@ -174,6 +174,10 @@ export default cliargs => [ }, external: externals.browser, plugins: [ + excludeLines({ + include: 'src/js/**', + patterns: [/\/\/\s*exclude\s*start[\s\S]*?\/\/\s*exclude\s*end/g] + }), alias({ 'video.js': path.resolve(__dirname, './src/js/video.js') }), @@ -198,6 +202,10 @@ export default cliargs => [ }, external: externals.test, plugins: [ + excludeLines({ + include: 'src/js/**', + patterns: [/\/\/\s*exclude\s*start[\s\S]*?\/\/\s*exclude\s*end/g] + }), multiEntry({exports: false}), alias({ 'video.js': path.resolve(__dirname, './src/js/video.js') @@ -233,6 +241,10 @@ export default cliargs => [ ], external: externals.module, plugins: [ + excludeLines({ + include: 'src/js/**', + patterns: [/\/\/\s*exclude\s*start[\s\S]*?\/\/\s*exclude\s*end/g] + }), alias({ 'video.js': path.resolve(__dirname, './src/js/video.js'), 'videojs-contrib-quality-levels': path.resolve(__dirname, './node_modules/videojs-contrib-quality-levels/dist/videojs-contrib-quality-levels.es.js'), @@ -265,6 +277,10 @@ export default cliargs => [ external: externals.browser, plugins: [ primedIgnore, + excludeLines({ + include: 'src/js/**', + patterns: [/\/\/\s*exclude\s*start[\s\S]*?\/\/\s*exclude\s*end/g] + }), alias({ 'video.js': path.resolve(__dirname, './src/js/video.js') }), @@ -297,6 +313,10 @@ export default cliargs => [ ], external: externals.module, plugins: [ + excludeLines({ + include: 'src/js/**', + patterns: [/\/\/\s*exclude\s*start[\s\S]*?\/\/\s*exclude\s*end/g] + }), json(), primedBabel, svg(), @@ -318,6 +338,10 @@ export default cliargs => [ external: externals.browser, plugins: [ primedResolve, + excludeLines({ + include: 'src/js/**', + patterns: [/\/\/\s*exclude\s*start[\s\S]*?\/\/\s*exclude\s*end/g] + }), json(), primedExternalGlobals, primedCjs, @@ -342,6 +366,10 @@ export default cliargs => [ plugins: [ primedIgnore, primedResolve, + excludeLines({ + include: 'src/js/**', + patterns: [/\/\/\s*exclude\s*start[\s\S]*?\/\/\s*exclude\s*end/g] + }), json(), primedExternalGlobals, primedCjs, diff --git a/src/js/component.js b/src/js/component.js index ad8e67f627..b64e19c416 100644 --- a/src/js/component.js +++ b/src/js/component.js @@ -151,7 +151,9 @@ class Component { * @param {Function} fn * The function to call with `EventTarget`s */ + /* start-delete-from-build */ on(type, fn) {} + /* end-delete-from-build */ /** * Removes an `event listener` for a specific event from an instance of `EventTarget`. @@ -164,7 +166,9 @@ class Component { * @param {Function} [fn] * The function to remove. If not specified, all listeners managed by Video.js will be removed. */ + /* start-delete-from-build */ off(type, fn) {} + /* end-delete-from-build */ /** * This function will add an `event listener` that gets triggered only once. After the @@ -177,7 +181,9 @@ class Component { * @param {Function} fn * The function to be called once for each event name. */ + /* start-delete-from-build */ one(type, fn) {} + /* end-delete-from-build */ /** * This function will add an `event listener` that gets triggered only once and is @@ -191,7 +197,9 @@ class Component { * @param {Function} fn * The function to be called once for each event name. */ + /* start-delete-from-build */ any(type, fn) {} + /* end-delete-from-build */ /** * This function causes an event to happen. This will then cause any `event listeners` @@ -212,7 +220,9 @@ class Component { * @param {Object} [hash] * Optionally extra argument to pass through to an event listener */ + /* start-delete-from-build */ trigger(event, hash) {} + /* end-delete-from-build */ /** * Dispose of the `Component` and all child components. diff --git a/src/js/player.js b/src/js/player.js index 05c833cda8..89848c0b61 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -5339,11 +5339,11 @@ class Player extends Component { * @return {boolean} * Whether or not this player has the requested plugin available. */ - // exclude start + /* start-delete-from-build */ hasPlugin(name) { return false; } - // exclude end + /* end-delete-from-build */ /** * Reports whether or not a player is using a plugin by name. @@ -5358,9 +5358,11 @@ class Player extends Component { * @return {boolean} * Whether or not this player is using the requested plugin. */ + /* start-delete-from-build */ usingPlugin(name) { return false; } + /* end-delete-from-build */ } /**