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

Conversation

jboix
Copy link
Contributor

@jboix jboix commented Aug 20, 2024

Description

Exposes the version in the package.json of each existing plugin and component. Modified the create script template so that the VERSION is automatically added on every new package.

  • Retrieve the version of a component:

    player.SkipButton.constructor.VERSION
  • Retrieve the version of a plugin:

    player.pillarboxPlaylist().version()

Changes Made

  • Updates create script template to include the version of the generated component or plugin.
  • Expose the skip-button component version by adding a VERSION property to the constructor.
  • Expose the playlist-plugin version by adding a VERSION property to the constructor.

Checklist

  • I have followed the project's style and contribution guidelines.
  • I have performed a self-review of my own changes.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.

jboix added 2 commits August 20, 2024 10:04
Updates create script template to include the version of the generated component or plugin.
Expose the component version by adding a `VERSION` property to the constructor, to
retrieve the version of the component on a given player simply do:

```javascript
// Retrieve the player
const player = document.getElementsByTagName('video')[0].parentElement.player;
// Print the component version
console.log(player.SkipButton.constructor.VERSION);
```
@jboix jboix requested a review from amtins August 20, 2024 08:13
@jboix jboix self-assigned this Aug 20, 2024
Copy link

github-actions bot commented Aug 20, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 99.27% 1230 / 1239
🔵 Statements 99.27% 1230 / 1239
🔵 Functions 95.06% 77 / 81
🔵 Branches 93.7% 119 / 127
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/pillarbox-playlist/src/pillarbox-playlist.js 98.58% 88.88% 92.85% 98.58% 156-159, 449, 473-474
packages/skip-button/src/skip-button.js 97.67% 88.88% 75% 97.67% 80-81
Generated in workflow #101

Copy link

github-actions bot commented Aug 20, 2024

PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-08-29 12:30 UTC

Expose the plugin version by adding a static getter `VERSION` to all plugins and
components. To retrieve the version of the component on a given player simply do:

```javascript
// Retrieve the player
const player = document.getElementsByTagName('video')[0].parentElement.player;
// Print the component version
console.log(player.pillarboxPlaylist().version());
```
@jboix jboix force-pushed the fix/expose-version branch from 475d934 to 1e07832 Compare August 27, 2024 09:58
Comment on lines +78 to +81

static get VERSION() {
return version;
}
Copy link
Member

Choose a reason for hiding this comment

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

Thanks 👍🏽

Copy link
Member

@amtins amtins left a comment

Choose a reason for hiding this comment

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

LGTM!

@jboix jboix merged commit 0b57214 into main Aug 29, 2024
4 checks passed
@jboix jboix deleted the fix/expose-version branch August 29, 2024 12:30
Copy link

🎉 This PR is included in version @srgssr/pillarbox-playlist-v2.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version @srgssr/skip-button-v1.0.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants