Skip to content

Commit

Permalink
Merge branch 'release-candidate' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLantukh committed Jul 5, 2024
2 parents 5ba16d3 + 94df606 commit fea9182
Show file tree
Hide file tree
Showing 59 changed files with 6,372 additions and 3,424 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/release-build-tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ jobs:
create-new-release-version:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-create-release-candidate-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.ACTION_TOKEN }}
ref: release
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
input-file: 'CHANGELOG.md'

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.ACTION_TOKEN }}
title: Release Candidate - ${{ steps.changelog.outputs.tag }}${{ github.ref_name != 'develop' && ' (Hotfix)' || ''}}
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/test-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@ jobs:
lint:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: '20.x'
- name: yarn install, lint
run: |
yarn install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
14 changes: 5 additions & 9 deletions .github/workflows/test-unit-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@ name: Test - Unit and Snapshot

on:
push:
branches: [ 'develop', 'release' ]
branches: ['develop', 'release']
pull_request:

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: '20.x'
- name: yarn install and test
run: |
yarn
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/web-test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Web - Test - End to End
on:
pull_request:
push:
branches: [ 'develop', 'release' ]
branches: ['develop', 'release']
schedule:
- cron: '30 3 * * 1-5'
workflow_dispatch:
Expand All @@ -19,15 +19,14 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [18.x]
config: [desktop, mobile]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: '20.x'
- name: Install dependencies
run: |
yarn
Expand All @@ -41,7 +40,7 @@ jobs:
WORKER_COUNT: 2
- name: Uploading artifact
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: allure-report-${{ matrix.config }}
path: ./platforms/web/test-e2e/output/${{ matrix.config }}
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [6.4.0](https://github.com/jwplayer/ott-web-app/compare/v6.3.0...v6.4.0) (2024-07-04)


### Features

* add log service ([7717a2a](https://github.com/jwplayer/ott-web-app/commit/7717a2a1afed6e379c0fcabb52c1c826f6b47ba1))

## [6.3.0](https://github.com/jwplayer/ott-web-app/compare/v6.2.0...v6.3.0) (2024-06-24)


Expand Down
12 changes: 6 additions & 6 deletions configs/eslint-config-jwp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"test": "exit 0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"confusing-browser-globals": "^1.0.10",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0"
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"confusing-browser-globals": "^1.0.11",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2"
}
}
6 changes: 3 additions & 3 deletions configs/postcss-config-jwp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"test": "exit 0"
},
"devDependencies": {
"postcss": "^8.4.31",
"postcss-import": "^14.0.2",
"postcss-scss": "^4.0.4",
"postcss": "^8.4.38",
"postcss-import": "^14.1.0",
"postcss-scss": "^4.0.9",
"stylelint": "^15.11.0"
},
"peerDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions configs/stylelint-config-jwp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"devDependencies": {
"stylelint": "^15.11.0",
"stylelint-config-recommended-scss": "^13.1.0",
"stylelint-declaration-strict-value": "^1.9.2",
"stylelint-order": "^6.0.3",
"stylelint-scss": "^5.3.1"
"stylelint-declaration-strict-value": "^1.10.4",
"stylelint-order": "^6.0.4",
"stylelint-scss": "^5.3.2"
}
}
4 changes: 0 additions & 4 deletions knip.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ const config: KnipConfig = {
workspaces: {
'.': {
entry: ['scripts/**/*'],
ignoreDependencies: [
// Workspace packages
'eslint-config-jwp',
],
ignoreBinaries: [
// false positives from yarn scripts in github actions
'build',
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jwp/ott",
"version": "6.3.0",
"version": "6.4.0",
"private": true,
"license": "Apache-2.0",
"repository": "https://github.com/jwplayer/ott-web-app.git",
Expand Down Expand Up @@ -36,21 +36,21 @@
"web": "yarn --cwd platforms/web"
},
"devDependencies": {
"@commitlint/cli": "^12.1.1",
"@commitlint/config-conventional": "^12.1.1",
"@types/node": "^18.15.3",
"csv-parse": "^5.4.0",
"@commitlint/cli": "^17.8.1",
"@commitlint/config-conventional": "^17.8.1",
"@types/node": "^18.19.36",
"csv-parse": "^5.5.6",
"eslint": "^8.57.0",
"husky": "^6.0.0",
"i18next-parser-workspaces": "^0.2.0",
"knip": "^5.0.3",
"lint-staged": "^15.1.0",
"knip": "^5.21.1",
"lint-staged": "^15.2.7",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"read": "^2.1.0",
"ts-node": "^10.9.1",
"ts-node": "^10.9.2",
"typescript": "5.3.3",
"vitest": "^1.3.1"
"vitest": "^1.6.0"
},
"peerDependencies": {
"eslint-config-jwp": "*"
Expand Down
26 changes: 13 additions & 13 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@
"test-watch": "TZ=UTC LC_ALL=en_US.UTF-8 vitest"
},
"dependencies": {
"@inplayer-org/inplayer.js": "^3.13.24",
"@inplayer-org/inplayer.js": "^3.13.25",
"broadcast-channel": "^7.0.0",
"date-fns": "^2.28.0",
"fast-xml-parser": "^4.3.2",
"i18next": "^22.4.15",
"date-fns": "^2.30.0",
"fast-xml-parser": "^4.4.0",
"i18next": "^22.5.1",
"ini": "^3.0.1",
"inversify": "^6.0.1",
"jwt-decode": "^3.1.2",
"inversify": "^6.0.2",
"jwt-decode": "^4.0.0",
"lodash.merge": "^4.6.2",
"react-i18next": "^12.3.1",
"reflect-metadata": "^0.1.13",
"yup": "^0.32.9",
"zustand": "^3.6.9"
"reflect-metadata": "^0.2.2",
"yup": "^0.32.11",
"zustand": "^3.7.2"
},
"devDependencies": {
"@types/ini": "^1.3.31",
"@types/lodash.merge": "^4.6.6",
"@types/ini": "^1.3.34",
"@types/lodash.merge": "^4.6.9",
"jsdom": "^22.1.0",
"timezone-mock": "^1.3.4",
"timezone-mock": "^1.3.6",
"vi-fetch": "^0.8.0",
"vitest": "^1.3.1"
"vitest": "^1.6.0"
},
"peerDependencies": {
"@jwp/ott-testing": "*",
Expand Down
13 changes: 9 additions & 4 deletions packages/common/src/controllers/AccountController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import i18next from 'i18next';
import { inject, injectable } from 'inversify';

import { DEFAULT_FEATURES } from '../constants';
import { logDev } from '../utils/common';
import type { IntegrationType } from '../../types/config';
import CheckoutService from '../services/integrations/CheckoutService';
import AccountService, { type AccountServiceFeatures } from '../services/integrations/AccountService';
Expand All @@ -24,6 +23,7 @@ import { useAccountStore } from '../stores/AccountStore';
import { useConfigStore } from '../stores/ConfigStore';
import { useProfileStore } from '../stores/ProfileStore';
import { FormValidationError } from '../errors/FormValidationError';
import { logError } from '../logger';

import WatchHistoryController from './WatchHistoryController';
import ProfileController from './ProfileController';
Expand Down Expand Up @@ -68,7 +68,7 @@ export default class AccountController {
await this.getAccount();
}
} catch (error: unknown) {
logDev('Failed to get user', error);
logError('AccountController', 'Failed to get user', { error });

// clear the session when the token was invalid
// don't clear the session when the error is unknown (network hiccup or something similar)
Expand Down Expand Up @@ -386,7 +386,12 @@ export default class AccountController {
return !!responseData?.accessGranted;
};

reloadSubscriptions = async ({ delay, retry }: { delay?: number; retry?: number } = { delay: 0, retry: 0 }): Promise<unknown> => {
reloadSubscriptions = async (
{ delay, retry }: { delay?: number; retry?: number } = {
delay: 0,
retry: 0,
},
): Promise<unknown> => {
useAccountStore.setState({ loading: true });

const { getAccountInfo } = useAccountStore.getState();
Expand Down Expand Up @@ -436,7 +441,7 @@ export default class AccountController {
pendingOffer = offerResponse.responseData;
}
} catch (error: unknown) {
logDev('Failed to fetch the pending offer', error);
logError('AccountController', 'Failed to fetch the pending offer', { error });
}

// let the app know to refresh the entitlements
Expand Down
3 changes: 3 additions & 0 deletions packages/common/src/controllers/AppController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { Config } from '../../types/config';
import type { CalculateIntegrationType } from '../../types/calculate-integration-type';
import { DETERMINE_INTEGRATION_TYPE } from '../modules/types';
import { useConfigStore } from '../stores/ConfigStore';
import { logDebug } from '../logger';

import WatchHistoryController from './WatchHistoryController';
import FavoritesController from './FavoritesController';
Expand Down Expand Up @@ -63,6 +64,8 @@ export default class AppController {
};

initializeApp = async (url: string, refreshEntitlements?: () => Promise<void>) => {
logDebug('AppController', 'Initializing app', { url });

const settings = await this.settingsService.initialize();
const configSource = await this.settingsService.getConfigSource(settings, url);
const config = await this.loadAndValidateConfig(configSource);
Expand Down
12 changes: 2 additions & 10 deletions packages/common/src/controllers/EpgController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import livePlaylistFixture from '@jwp/ott-testing/fixtures/livePlaylist.json';

import EpgService from '../services/EpgService';
import type { Playlist } from '../../types/playlist';
import { mockService } from '../../test/mockService';

import EpgController from './EpgController';

Expand All @@ -13,15 +14,6 @@ const livePlaylist = livePlaylistFixture as Playlist;
const transformProgram = vi.fn();
const fetchSchedule = vi.fn();

vi.mock('@jwp/ott-common/src/modules/container', () => ({
getNamedModule: (type: typeof EpgService) => {
switch (type) {
case EpgService:
return { transformProgram, fetchSchedule };
}
},
}));

const epgController = new EpgController();

const mockProgram1 = {
Expand All @@ -46,13 +38,13 @@ const mockProgram2 = {

describe('epgService', () => {
beforeEach(() => {
mockService(EpgService, { transformProgram, fetchSchedule });
vi.useFakeTimers();
});

afterEach(() => {
// must be called before `vi.useRealTimers()`
unregister();
vi.restoreAllMocks();
vi.useRealTimers();
});

Expand Down
Loading

0 comments on commit fea9182

Please sign in to comment.