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

Feat / Restructure and a11y #435

Merged
merged 42 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
b088167
refactor: initialize workspace and separate services, stores and utils
ChristiaanScheermeijer Nov 17, 2023
b231abe
chore: update configurations and set up linting
ChristiaanScheermeijer Nov 20, 2023
6748fad
refactor(project): move web assets to theme package
ChristiaanScheermeijer Nov 20, 2023
653054f
docs: add i18n package readme
ChristiaanScheermeijer Nov 24, 2023
949ab1c
refactor: store supported languages in config store
ChristiaanScheermeijer Nov 27, 2023
9b06145
chore: update release workflow
ChristiaanScheermeijer Nov 30, 2023
a4dbc40
refactor: move web into platforms directory
ChristiaanScheermeijer Dec 15, 2023
ab4f4e7
chore: update web platform directory in workflows
ChristiaanScheermeijer Dec 15, 2023
fde6081
chore: update gitignore
ChristiaanScheermeijer Dec 15, 2023
0d23fe2
chore: fix epg fixtures
ChristiaanScheermeijer Dec 15, 2023
06c4f3e
refactor(project): remove vite from common, ui-react and hooks-react …
royschut Jan 9, 2024
21945fd
feat: remove browser typings from common
ChristiaanScheermeijer Jan 12, 2024
4869cc9
refactor(project): remove react from common package (#9)
royschut Jan 12, 2024
c630ace
feat(player): show nice error message when media item is geo blocked
langemike Jan 12, 2024
ea9c602
refactor(project): move icons to theme folder (#21)
MelissaDTH Jan 12, 2024
9955388
refactor(project): add createURL util to replace all url utils
royschut Jan 12, 2024
d16f0e6
refactor(project): remove react-router from hooks-react package
royschut Jan 12, 2024
3c2f81e
refactor: allow custom integration registration via container
ChristiaanScheermeijer Jan 10, 2024
3079b20
refactor(project): split url creation from location based
royschut Jan 15, 2024
d7143bf
feat(accessibility): accessibility improvements and quick wins
MelissaDTH Jan 3, 2024
684c9bb
fix(a11y): alertdialog with aria-modal for alert component
langemike Jan 9, 2024
fe97a75
fix(a11y): apply section to account and payment pages
R-Cloud-Designs Jan 11, 2024
029a0a0
refactor(a11y): refactor language menu switch for accessibility compl…
royschut Jan 15, 2024
e7b7568
fix(a11y): cards optimized for screen readers
langemike Jan 12, 2024
547a0f7
feat(i18n): reflect language switching in root html lang tag.
R-Cloud-Designs Jan 12, 2024
533697b
feat(a11y): make user menu keyboard accessible
royschut Jan 15, 2024
1865f42
fix: language menu button
ChristiaanScheermeijer Jan 17, 2024
c812c02
fix: slow login and preventable errors
ChristiaanScheermeijer Jan 17, 2024
f302dbd
fix: load subscription after restoring SVOD session
ChristiaanScheermeijer Jan 17, 2024
22bf874
fix(auth): set the correct loading state after logging the user in ac…
Jan 17, 2024
f1bd9c0
Merge branch 'develop' into feat/release-sprint-2024-1
ChristiaanScheermeijer Jan 18, 2024
d1ddcdb
fix: refresh entitlements on tvod purchase
ChristiaanScheermeijer Jan 18, 2024
6d7dc12
Merge branch 'develop' into feat/release-sprint-2024-1
ChristiaanScheermeijer Jan 18, 2024
949d709
chore: fix depcheck errors
ChristiaanScheermeijer Jan 18, 2024
fdb7e35
fix: infinite loader when buying a subscription
ChristiaanScheermeijer Jan 19, 2024
6624367
Merge branch 'develop' into feat/release-sprint-2024-1
ChristiaanScheermeijer Jan 23, 2024
298153e
Merge branch 'develop' into feat/release-sprint-2024-1
ChristiaanScheermeijer Jan 25, 2024
d151e83
docs(project): update documentation for workspaces
ChristiaanScheermeijer Jan 26, 2024
4057cad
chore: rename web specific workflows
ChristiaanScheermeijer Jan 26, 2024
d74f3f0
chore: pr feedback
ChristiaanScheermeijer Jan 29, 2024
ca38d06
chore: move build packages to configs directory
ChristiaanScheermeijer Jan 29, 2024
d6f7c84
fix: epg service bindings
ChristiaanScheermeijer Jan 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
'user',
'watchhistory',
'favorites',
'profiles',
'analytics',
'pwa',
'seo',
Expand All @@ -29,6 +30,7 @@ module.exports = {
'epg',
'tests',
'i18n',
'a11y',
],
],
},
Expand Down
38 changes: 12 additions & 26 deletions .depcheckrc.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,16 @@
ignores: [
# These are dependencies for vite and vite plugins that depcheck doesn't recognize as being used
'postcss-scss',
'stylelint-order',
'stylelint-config-recommended-scss',
'stylelint-declaration-strict-value',
'stylelint-scss',
'@vitest/coverage-v8',
# This is used by commitlint in .commitlintrc.js
'@commitlint/config-conventional',
# These are vite aliases / tsconfig paths that point to specific local directories
# Note the \ is necessary to escape the # or the ignore doesn't work
'\#src',
'\#test',
'\#types',
'\#components',
'\#utils',
'src', # This is used in src/styles, which recognizes absolute paths from the repo root
'allure-commandline', # To support e2e-reports
'@codeceptjs/allure-legacy',
'faker',
'i18next-parser', # For extracting i18next translation keys
'npm-run-all', # To run linting checks
'virtual:pwa-register', # Service Worker code is injected at build time
'vite-plugin-pwa/client', # Used to generate pwa framework
'reflect-metadata', # Used for ioc resolution
'@babel/plugin-proposal-decorators', # Used to build with decorators for ioc resolution
'babel-plugin-transform-typescript-metadata', # Used to build with decorators for ioc resolution
'@babel/core', # Required peer dependency for babel plugins above

# @todo: remove dep from main package, once i18next is moved to specific packages
'ts-node',

# Workspace packages
'eslint-config-jwp',
'@typescript-eslint/parser', # Required by eslint-config-jwp
'@typescript-eslint/eslint-plugin', # Required by eslint-config-jwp
'eslint-plugin-import', # Required by eslint-config-jwp

'depcheck',
'ts-node'
]
6 changes: 2 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Modules
node_modules/

# Test
coverage/

# Build output
build/

coverage/
128 changes: 1 addition & 127 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,129 +1,3 @@
const restrictedGlobals = require('confusing-browser-globals');

module.exports = {
parser: '@typescript-eslint/parser',

plugins: [
// Enable Typescript linting
'@typescript-eslint',

// Enable linting imports
'import',
],

extends: [
// Use default ESLint rules
'eslint:recommended',

// Use recommended TS rules
'plugin:@typescript-eslint/recommended',

// Use recommended React rules
'plugin:react/recommended',

'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
],

env: {
// Browser conf
browser: true,
es6: true,
},

rules: {
// Prevent development/debugging statements
'no-console': ['error', { allow: ['warn', 'error', 'info', 'debug'] }],
'no-alert': 'error',
'no-debugger': 'error',

// Prevent usage of confusing globals
'no-restricted-globals': ['error'].concat(restrictedGlobals),

// Assignments in function returns is confusing and could lead to unwanted side-effects
'no-return-assign': ['error', 'always'],

curly: ['error', 'multi-line'],

// Strict import ordering
'import/order': [
'warn',
{
groups: ['builtin', 'external', 'parent', 'sibling', 'index'],
pathGroups: [
// Sort absolute root imports before parent imports
{
pattern: '/**',
group: 'parent',
position: 'before',
},
],
'newlines-between': 'always',
},
],
// Not needed in React 17
'react/react-in-jsx-scope': 'off',
'import/no-named-as-default-member': 'off',
},
overrides: [
{
files: ['*.js'],
env: {
// We may still use CJS in .js files (eg. local scripts)
commonjs: true,
},
rules: {
// `require` is still allowed/recommended in JS
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['*.ts', '*.tsx'],
rules: {
// TypeScript 4.0 adds 'any' or 'unknown' type annotation on catch clause variables.
// We need to make sure error is of the type we are expecting
'@typescript-eslint/no-implicit-any-catch': 'error',

// These are handled by TS
'@typescript-eslint/no-explicit-any': ['warn', { ignoreRestArgs: true }],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'import/no-unresolved': 'off',
},
},
{
files: ['*.jsx', '*.tsx', 'src/hooks/*.ts'],
plugins: [
// Enable linting React code
'react',
'react-hooks',
],
rules: {
// Help with Hooks syntax
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',

// Handled by Typescript
'react/prop-types': 'off',

// This rule causes too many false positives, eg. with default exports or child render function
'react/display-name': 'off',
},
},
],

settings: {
react: {
pragma: 'React',
version: '17',
},
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
extends: ['jwp/typescript'],
};
3 changes: 2 additions & 1 deletion .github/workflows/release-build-tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
echo "current-version=${version}" >> "$GITHUB_OUTPUT"

- name: Build App
working-directory: ./platforms/web
run: |
yarn build
cd build
Expand Down Expand Up @@ -51,7 +52,7 @@ jobs:
if: ${{ steps.package-version.outputs.current-version }}
with:
commit: 'release'
artifacts: 'build/ott-web-app-build-*.tar.gz, build/ott-web-app-build-*.zip'
artifacts: 'web/build/ott-web-app-build-*.tar.gz, web/build/ott-web-app-build-*.zip'
tag: v${{ steps.package-version.outputs.current-version }}
bodyFile: '.github/RELEASE_BODY_TEMPLATE.md'
token: ${{ secrets.github_token }}
2 changes: 1 addition & 1 deletion .github/workflows/test-unit-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: yarn install, build, and test
- name: yarn install and test
run: |
yarn
yarn test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
name: Release - Deploy Prod Demo Site
name: Web - Release - Deploy Prod Demo Site

on:
push:
branches: ['release']
workflow_dispatch:

defaults:
run:
working-directory: ./platforms/web

jobs:
deploy_live_website:
runs-on: ubuntu-latest
Expand All @@ -20,3 +24,4 @@ jobs:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
channelId: live
entryPoint: './platforms/web'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test - End to End
name: Web - Test - End to End

on:
pull_request:
Expand All @@ -8,6 +8,10 @@ on:
- cron: '30 3 * * 1-5'
workflow_dispatch:

defaults:
run:
working-directory: ./platforms/web

jobs:
test-e2e:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -40,5 +44,5 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: allure-report-${{ matrix.config }}
path: ./test-e2e/output/${{ matrix.config }}
path: ./platforms/web/test-e2e/output/${{ matrix.config }}
retention-days: 7
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: Test - Deploy Preview and Lighthouse Test
name: Web - Test - Deploy Preview and Lighthouse Test

on:
pull_request:

defaults:
run:
working-directory: ./platforms/web

jobs:
build_and_preview:
name: Build and preview
Expand All @@ -18,6 +22,7 @@ jobs:
- uses: FirebaseExtended/action-hosting-deploy@v0
id: firebase_hosting_preview
with:
entryPoint: './platforms/web'
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
expires: 30d
Expand Down
15 changes: 0 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
# project, build, and deployment
node_modules
build
.snowpack
coverage
output
public/locales/**/*_old.json
yarn-error.log
.firebase
firebase-debug.log
.stylelintcache
.lighthouseci

# os or editor
.idea
.DS_Store
.vscode/

# ignore local files
*.local

# Exclude ini files because they have customer specific data
ini/*.ini

# Ignore working area for i18n checks
.temp-translations
39 changes: 39 additions & 0 deletions .syncpackrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"$schema": "https://unpkg.com/[email protected]/dist/schema.json",
"semverGroups": [
{
"dependencies": ["codeceptjs", "codeceptjs**", "react-router", "react-router-dom"],
"packages": ["**"],
"isIgnored": true
},
{
"range": "^",
"dependencies": ["**"],
"packages": ["**"],
"dependencyTypes": ["prod", "dev", "peer", "resolutions"]
}
],
"versionGroups": [
{
"label": "Ensure semver ranges for locally developed packages satisfy the local version",
"dependencies": ["@jwp/**", "**-config-jwp"],
"dependencyTypes": ["peer"],
"packages": ["**"],
"pinVersion": "*"
},
{
"label": "Ensure local packages are installed as peerDependency",
"dependencies": ["@jwp/**", "**-config-jwp"],
"dependencyTypes": ["dev", "prod"],
"packages": ["**"],
"isBanned": true
},
{
"dependencies": ["@types/**"],
"dependencyTypes": ["!dev"],
"packages": ["**"],
"isBanned": true,
"label": "@types packages should only be under devDependencies"
}
]
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ The JW OTT Webapp is an open-source, dynamically generated video website built a
- [Frameworks, SDKs and Libraries](./docs/frameworks.md)
- [Backend Services](./docs/backend-services.md)
- [Developer Guidelines](./docs/developer-guidelines.md)
- [Workspaces](./docs/workspaces.md)

## Supported Features

Expand Down
8 changes: 8 additions & 0 deletions configs/eslint-config-jwp/.depcheckrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ignores: [
# Dynamically loaded in the eslint config
'@typescript-eslint/eslint-plugin',
'@typescript-eslint/parser',
'eslint-plugin-import',
'eslint-plugin-react',
'eslint-plugin-react-hooks'
]
3 changes: 3 additions & 0 deletions configs/eslint-config-jwp/lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
'*.js': ['eslint --fix', 'prettier --write'],
};
17 changes: 17 additions & 0 deletions configs/eslint-config-jwp/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "eslint-config-jwp",
"version": "1.0.0",
"private": true,
"scripts": {
"lint:ts": "exit 0",
"test": "exit 0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"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"
}
}
Loading
Loading