Skip to content

Commit

Permalink
Revert "feat(project)!: restructure for multiplatforms with workspaces (
Browse files Browse the repository at this point in the history
#435)"

This reverts commit 7464def.
  • Loading branch information
mirovladimitrovski committed Feb 5, 2024
1 parent 7464def commit 3058141
Show file tree
Hide file tree
Showing 893 changed files with 10,586 additions and 10,505 deletions.
2 changes: 0 additions & 2 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module.exports = {
'user',
'watchhistory',
'favorites',
'profiles',
'analytics',
'pwa',
'seo',
Expand All @@ -30,7 +29,6 @@ module.exports = {
'epg',
'tests',
'i18n',
'a11y',
],
],
},
Expand Down
38 changes: 26 additions & 12 deletions .depcheckrc.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
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',

# @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'
# 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
]
3 changes: 0 additions & 3 deletions platforms/web/.env → .env
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
APP_API_BASE_URL=https://cdn.jwplayer.com
APP_PLAYER_ID=M4qoGvUk


### Web-only env vars (not sent to common/src/env configureEnv())

# the default language that the app should load when the language couldn't be detected
APP_DEFAULT_LANGUAGE=en

Expand Down
File renamed without changes.
6 changes: 4 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Modules
node_modules/

build/

# Test
coverage/

# Build output
build/
128 changes: 127 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,129 @@
const restrictedGlobals = require('confusing-browser-globals');

module.exports = {
extends: ['jwp/typescript'],
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,
},
},
};
File renamed without changes.
3 changes: 1 addition & 2 deletions .github/workflows/release-build-tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
echo "current-version=${version}" >> "$GITHUB_OUTPUT"
- name: Build App
working-directory: ./platforms/web
run: |
yarn build
cd build
Expand Down Expand Up @@ -52,7 +51,7 @@ jobs:
if: ${{ steps.package-version.outputs.current-version }}
with:
commit: 'release'
artifacts: 'web/build/ott-web-app-build-*.tar.gz, web/build/ott-web-app-build-*.zip'
artifacts: 'build/ott-web-app-build-*.tar.gz, build/ott-web-app-build-*.zip'
tag: v${{ steps.package-version.outputs.current-version }}
bodyFile: '.github/RELEASE_BODY_TEMPLATE.md'
token: ${{ secrets.github_token }}
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
name: Web - Release - Deploy Prod Demo Site
name: 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 @@ -24,4 +20,3 @@ 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: Web - Test - End to End
name: Test - End to End

on:
pull_request:
Expand All @@ -8,10 +8,6 @@ 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 @@ -44,5 +40,5 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: allure-report-${{ matrix.config }}
path: ./platforms/web/test-e2e/output/${{ matrix.config }}
path: ./test-e2e/output/${{ matrix.config }}
retention-days: 7
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
name: Web - Test - Deploy Preview and Lighthouse Test
name: 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 @@ -22,7 +18,6 @@ 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
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 and test
- name: yarn install, build, and test
run: |
yarn
yarn test
Expand Down
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
# 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: 0 additions & 39 deletions .syncpackrc.json

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ 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: 0 additions & 8 deletions configs/eslint-config-jwp/.depcheckrc.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions configs/eslint-config-jwp/lint-staged.config.js

This file was deleted.

Loading

0 comments on commit 3058141

Please sign in to comment.