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

fix: expose version on existing plugins and components #31

Merged
merged 3 commits into from
Aug 29, 2024
Merged
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
5 changes: 5 additions & 0 deletions packages/pillarbox-playlist/src/pillarbox-playlist.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import videojs from 'video.js';
import { version } from '../package.json';

/**
* @ignore
Expand Down Expand Up @@ -467,6 +468,10 @@ export class PillarboxPlaylist extends Plugin {
currentIndex: this.currentIndex_
});
}

static get VERSION() {
return version;
}
}

PillarboxPlaylist.prototype.options_ = {
Expand Down
5 changes: 5 additions & 0 deletions packages/skip-button/src/skip-button.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pillarbox from '@srgssr/pillarbox-web';
import { version } from '../package.json';
import './lang';

/**
Expand Down Expand Up @@ -74,6 +75,10 @@ class SkipButton extends Button {
this.controlText(text);
this.show();
}

static get VERSION() {
return version;
}
Comment on lines +78 to +81
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍🏽

}

pillarbox.registerComponent('SkipButton', SkipButton);
Expand Down
9 changes: 9 additions & 0 deletions scripts/template/src/{{kebabCase name}}.js.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {{platform}} from '{{importAlias}}';
import { version } from '../package.json';
{{#if wantLocalization}}import './lang';{{/if}}

{{#ifEq type 'Plugin'}}
Expand All @@ -21,6 +22,10 @@ class {{properCase name}} extends Plugin {
constructor(player, options) {
super(player, options);
}

static get VERSION() {
return version;
}
}

{{platform}}.registerPlugin('{{camelCase name}}', {{properCase name}});
Expand Down Expand Up @@ -52,6 +57,10 @@ class {{properCase name}} extends {{type}} {
handleLanguagechange() {
super.handleLanguagechange();
}

static get VERSION() {
return version;
}
}

{{platform}}.registerComponent('{{properCase name}}', {{properCase name}});
Expand Down
Loading