Skip to content

Commit

Permalink
Merge pull request #2 from THEOplayer/conviva
Browse files Browse the repository at this point in the history
Conviva
  • Loading branch information
georgechoustoulakis authored Feb 21, 2024
2 parents e7428f6 + 9bea384 commit 927fe33
Show file tree
Hide file tree
Showing 62 changed files with 2,050 additions and 412 deletions.
6 changes: 6 additions & 0 deletions .changeset/chilly-cars-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@theoplayer/conviva-connector-web": major
---

Updated dependencies:
- @theoplayer/yospace-connector-web@2.0.0
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"updateInternalDependencies": "minor",
"ignore": []
}
7 changes: 6 additions & 1 deletion .changeset/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ const getReleaseLine = async (changeset, type, changelogOpts) => {
* @type {import('@changesets/types').GetDependencyReleaseLine}
*/
const getDependencyReleaseLine = async (changesets, dependenciesUpdated, changelogOpts) => {
return '';
if (dependenciesUpdated.length === 0) return "";

const updatedDependenciesList = dependenciesUpdated.map(
(dependency) => ` - ${dependency.name}@${dependency.newVersion}`
);
return [['- Updated dependencies:'], ...updatedDependenciesList].join("\n");
}

/**
Expand Down
5 changes: 5 additions & 0 deletions .changeset/poor-ads-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@theoplayer/yospace-connector-web": minor
---

Exposed SessionErrorCode.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*/dist/
*/test/pages/
35 changes: 29 additions & 6 deletions yospace/.eslintrc.json → .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@
"es2021": true,
"jest": true
},
"extends": ["airbnb-base", "eslint:recommended", "prettier"],
"extends": [
"airbnb-base",
"eslint:recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "import"],
"plugins": [
"@typescript-eslint",
"import"
],
"rules": {
"class-methods-use-this": 0,
"import/extensions": [
Expand All @@ -27,10 +34,23 @@
"import/no-unresolved": 1,
"no-shadow": "off",
"no-use-before-define": 0,
"max-classes-per-file": ["error", 5],
"max-classes-per-file": [
"error",
5
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["warn", {"argsIgnorePattern": "^_"}],
"@typescript-eslint/no-shadow": 1
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/no-shadow": 1,
"no-useless-return": 0,
"prefer-destructuring": 0,
"no-console": 0,
"no-plusplus": 0,
"lines-between-class-members": 0
},
"settings": {
"import/resolver": {
Expand All @@ -40,5 +60,8 @@
}
}
},
"ignorePatterns": ["lib/**/*", "dist/**/*"]
"ignorePatterns": [
"lib/**/*",
"dist/**/*"
]
}
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci --workspaces
run: npm ci --workspaces --include-workspace-root
- name: Build
run: npm run build
- name: Create release PR or publish to npm
id: changesets
uses: changesets/action@v1
Expand Down
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/web-connectors.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*/dist/
*/test/pages/
6 changes: 5 additions & 1 deletion yospace/.prettierrc.json → .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
"printWidth": 120,
"tabWidth": 4,
"trailingComma": "none",
"singleQuote": true,
"overrides": [
{
"files": ["**/*.json", "**/*.yml"],
"files": [
"**/*.json",
"**/*.yml"
],
"options": {
"tabWidth": 2
}
Expand Down
24 changes: 24 additions & 0 deletions conviva/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# These are some examples of commonly ignored file patterns.
# You should customize this list as applicable to your project.
# Learn more about .gitignore:
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore

# Node artifact files
node_modules/
lib/
dist/

# JetBrains IDE
.idea/

# Unit test reports
TEST*.xml

# Generated by MacOS
.DS_Store

# Generated by Windows
Thumbs.db

# THEOplayer build and TypeScript definitions
local/
59 changes: 59 additions & 0 deletions conviva/BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# conviva-connector-web

A connector implementing Conviva for web.

## Getting started

```
npm install
```

## Testing and code quality

A test stack is set up and can be used by adding tests to the `test/unit/` folder. Run these tests with

```
npm run test
```

This project is set up with [ESLint](https://eslint.org/) and [Prettier](https://prettier.io/). You can run these checks with

```
npm run lint
npm run prettier
```

but it's a good idea to set up the necessary IDE integration for both.

CI will automatically verify whether the code passes all necessary quality gates.

## Manual testing

- Run `npm run serve` to start `http-server` in the root folder by running.
- Run `npm run build` to create the integrations library `conviva-connector.umd.js` under `dist/`.
- Navigate to `localhost:8080/test/pages/main_umd.html` or add an alternative test page.

## Release process

This release process is based on the assumption that the `master` branch is the default branch, and working branches are branched off from it and PR's back to it.
It is mostly automated by creating tags with a specific format on the `master` branch.

### Prerequisites

- All the necesary code for the release is present on the `master` branch.
- The `README.md` file contains the necessary information for an external developer to use the connector. This will be published along with the code.
- Bitbucket Pipelines has been correctly enabled for the repository.
- Github Actions integration is on the roadmap.
- The necessary variables have been configured for Bitbucket Pipelines:
- `NPMRC_CONTENT`: the full content of an `.npmrc` file to be used during publishing. Linebreaks in the file can be substituted by `\n` in the variable.
- `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`: The AWS credentials necessary to publish a bundle to CDN.
- This might be replaced with a Github release artifact later.

### Creating a release

These steps assume that the new release version is `X.Y.Z`.

- Create a new version bump commit on the `master` branch to bump the project version to the release version.
- Create a tag on the version bump commit of the format `vX.Y.Z`.
- Verify that the release pipeline correctly runs for your new tag.
- Verify that the correct artifacts have been published once the pipeline has completed.
82 changes: 82 additions & 0 deletions conviva/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# @theoplayer/conviva-connector-web

## 1.3.0

### ✨ Features

- Updated to be compatible with THEOplayer `6.X`.

## 1.2.0

### ✨ Features

- Added error event with addition error information on playback failed.

## 1.1.7

### 🐛 Issues

- Removed reporting a buffering state on getting an `emptied` event.

## 1.1.6

### ✨ Features

- Added ad metadata for CSAI.

### 🐛 Issues

- Fixed an issue where the ad break position would be incorrectly reported.

## 1.1.5

### 🐛 Issues

- Updated yospace connector peer dependency.

## 1.1.4

### 🐛 Issues

- Fixed an issue where a session could be created without a source.

## 1.1.3

### Changed

- Made THEOplayer an external dependency.

## 1.1.2

### 🐛 Issues

- Fixed passing content length for a live stream or on early error.

## 1.1.1

### Changed

- Updated THEOplayer version to 5.X.

## 1.1.0

### ✨ Features

- Added `setContentInfo` to pass video metadata during playback.
- Added `setAdInfo` to pass ad metadata during playback.
- Added `reportPlaybackFailed` to notify Conviva of non-video errors.
- Added `stopAndStartNewSession` to enable explicitly stopping the current session and starting a new one.
- Added visibility change reporting.
- Updated THEOplayer version to 4.X.
- Improved error handling.
- Improved default metadata.

### 🐛 Issues

- Fixed handling a replay of the same source.

## 1.0.0

### ✨ Features

- Initial release
21 changes: 21 additions & 0 deletions conviva/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 THEO Technologies NV

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 927fe33

Please sign in to comment.