Skip to content

Commit

Permalink
fix: updated with latest master
Browse files Browse the repository at this point in the history
  • Loading branch information
nada-deriv committed Sep 22, 2023
2 parents a5bfcd5 + bb9754c commit 42f2247
Show file tree
Hide file tree
Showing 1,770 changed files with 70,117 additions and 35,181 deletions.
76 changes: 18 additions & 58 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ commands:
- "packages/hooks/node_modules"
- "packages/cfd/node_modules"
- "packages/indicators/node_modules"
- "packages/integration/node_modules"
- "packages/p2p/node_modules"
- "packages/reports/node_modules"
- "packages/shared/node_modules"
Expand All @@ -78,6 +79,7 @@ commands:
- "packages/translations/node_modules"
- "packages/utils/node_modules"
- "packages/analytics/node_modules"
- "packages/wallets/node_modules"
# VERIFY_CACHE_FOLDERS_END (DO NOT REMOVE)

build:
Expand Down Expand Up @@ -108,62 +110,15 @@ commands:
name: Tag
command: echo "<< parameters.version_name >>-$(date -u +"%Y-%m-%dT%H:%M:%SZ")" > packages/core/dist/version

docker_build_push:
description: "Build and Push image to docker hub"
parameters:
docker_image_latest_tag:
type: string
default: "latest-staging"
docker_image_name:
type: string
default: "deriv-app"
docker_file:
type: string
default: "Dockerfile"
steps:
- setup_remote_docker
- run:
name: Building docker image
command: |
TAG=${CIRCLE_TAG:-$CIRCLE_SHA1}
docker build -t ${DOCKHUB_ORGANISATION}/<< parameters.docker_image_name >>:${TAG} -t ${DOCKHUB_ORGANISATION}/<< parameters.docker_image_name >>:<< parameters.docker_image_latest_tag >> -f << parameters.docker_file >> .
- run:
name: Pushing Image to docker hub
command: |
TAG=${CIRCLE_TAG:-$CIRCLE_SHA1}
echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
docker push ${DOCKHUB_ORGANISATION}/<< parameters.docker_image_name >>:<< parameters.docker_image_latest_tag >>
docker push ${DOCKHUB_ORGANISATION}/<< parameters.docker_image_name >>:${TAG}
k8s_deploy:
description: "Deploy to k8s cluster"
parameters:
k8s_namespace:
type: string
default: "deriv-app-staging"
k8s_service:
type: string
default: "deriv-app"
steps:
- k8s/install-kubectl
- run:
name: Deploying to k8s cluster to namespace << parameters.k8s_namespace >>
command: |
TAG=${CIRCLE_TAG:-$CIRCLE_SHA1}
export NAMESPACE=<< parameters.k8s_namespace >>
git clone https://github.com/binary-com/devops-ci-scripts
cd devops-ci-scripts/k8s-build_tools
echo $CA_CRT | base64 --decode > ca.crt
./release.sh << parameters.k8s_service >> ${TAG}
publish_to_pages_staging:
description: "Publish to cloudflare pages"
steps:
- run:
name: "Publish to cloudflare pages (staging)"
command: |
npm i wrangler@2.0.19
npm i wrangler@3.1.0
cd packages/core
npx wrangler pages publish dist/ --project-name=deriv-app-pages --branch=staging
npx wrangler pages deploy dist/ --project-name=deriv-app-pages --branch=staging
echo "New staging website - http://staging.cf-pages-deriv-app.deriv.com"
publish_to_pages_production:
Expand All @@ -172,9 +127,9 @@ commands:
- run:
name: "Publish to cloudflare pages (production)"
command: |
npm i wrangler@2.0.19
npm i wrangler@3.1.0
cd packages/core
npx wrangler pages publish dist/ --project-name=deriv-app-pages --branch=main
npx wrangler pages deploy dist/ --project-name=deriv-app-pages --branch=main
echo "New website - http://cf-pages-deriv-app.deriv.com"
jobs:
Expand All @@ -201,8 +156,6 @@ jobs:
root: packages
paths:
- core
- docker_build_push
- k8s_deploy
- notify_slack
environment:
NODE_ENV: staging
Expand All @@ -221,10 +174,8 @@ jobs:
root: packages
paths:
- core
- docker_build_push:
docker_image_latest_tag: latest
- k8s_deploy:
k8s_namespace: "deriv-app-production"


- notify_slack
environment:
NODE_ENV: staging
Expand Down Expand Up @@ -252,7 +203,7 @@ jobs:
build_and_test:
docker:
- image: cimg/node:18.16.0
resource_class: large
resource_class: xlarge
steps:
- git_checkout_from_cache
- npm_install_from_cache
Expand All @@ -271,9 +222,18 @@ jobs:
- run:
name: "Check TypeScript for @deriv/stores"
command: npx tsc --project packages/stores/tsconfig.json -noEmit
- run:
name: "Check TypeScript for @deriv/wallets"
command: npx tsc --project packages/wallets/tsconfig.json -noEmit
# - run:
# name: "Check TypeScript for @deriv/cashier"
# command: npx tsc --project packages/cashier/tsconfig.json -noEmit
- run:
name: "Check ESLint for @deriv/wallets"
command: npx eslint --fix --config packages/wallets/.eslintrc.js packages/wallets
- run:
name: "Check Stylelint for @deriv/wallets"
command: npx stylelint packages/wallets/**/*.scss
- run:
name: "Check tests for @deriv/hooks"
command: bash ./scripts/check-tests.sh packages/hooks/src
Expand Down
139 changes: 1 addition & 138 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,142 +1,5 @@
module.exports = {
root: true,
parser: '@babel/eslint-parser',
plugins: ['prettier', 'testing-library', '@typescript-eslint'],
env: {
es6: true,
browser: true,
amd: true,
jest: true,
jquery: true,
jasmine: true,
},
globals: {
dataLayer: true,
texts_json: false,
},
ignorePatterns: ['**/dist/**/*.js', '**/lib/**/*.js'],
rules: {
camelcase: 0,
// semi : ['error', 'always'],
'array-callback-return': 0,
'arrow-body-style': 0,
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
curly: 0,
// 'comma-dangle' : ['error', 'always-multiline'],
'eol-last': ['error', 'always'],
'func-names': ['error', 'never'],
'key-spacing': 0,
'max-classes-per-file': ['warn', 2],
// 'keyword-spacing' : ['error', { after: true }],
'lines-between-class-members': 0,
indent: 0,
// 'max-len' : ['error', { code: 120, 'ignoreComments': true }],
// 'no-extra-semi' : 'error',
'no-console': 'error',
'no-else-return': ['error', { allowElseIf: true }],
'no-multi-assign': 0,
// 'no-multi-spaces' : [2, { exceptions: { 'BinaryExpression': true, 'VariableDeclarator': true, 'ImportDeclaration': true } }],
'no-param-reassign': ['error', { props: false }],
'no-restricted-globals': 0,
'no-script-url': 0,
// 'no-trailing-spaces' : ['error', { skipBlankLines: true }],
// 'object-curly-spacing' : ['error', 'always', { arraysInObjects: true, objectsInObjects: true }],
'one-var': ['error', { initialized: 'never', uninitialized: 'always' }],
'prefer-destructuring': 0,
quotes: 0,
// 'space-in-parens' : ['error', 'never'],
'space-infix-ops': 'error',
// 'space-unary-ops' : 'error',
// 'no-multiple-empty-lines' : ['error', { 'max': 1, 'maxEOF': 1 }],
'global-require': 'warn',

// import rules
'import/no-extraneous-dependencies': [
'warn',
{
devDependencies: [
'**/__tests__/**/*.js',
'**/test*.js',
'**/*.test.js*',
'**/*.spec.js',
'**/*.spec.jsx',
'**/*.spec.ts',
'**/*.test.ts',
'**/*.spec.tsx',
'**/*.test.tsx',
],
},
],

'import/no-useless-path-segments': 'error',
'import/order': [
0, // TODO: we should turn this to error after we sorted our import orders.
{
groups: [['builtin', 'external'], 'internal', 'sibling', 'parent'],
'newlines-between': 'ignore',
},
],
'spaced-comment': 'off',
'import/prefer-default-export': 0,
'import/extensions': [0, { jsx: 'always', json: 'always' }],
'no-sequences': ['warn'],
'import/no-unresolved': [2, { ignore: ['@deriv/components', '@deriv/shared'] }],

// react rules
// 'jsx-quotes' : ['error', 'prefer-single'],
// 'react/jsx-closing-bracket-location': ['error', { selfClosing: 'line-aligned', nonEmpty: 'line-aligned' }],
// 'react/jsx-closing-tag-location' : 'error',
// 'react/jsx-first-prop-new-line' : ['error', 'multiline-multiprop'],
// 'react/jsx-indent' : ['error', 4],
// 'react/jsx-indent-props' : ['error', 4],
// 'react/jsx-max-props-per-line' : ['error', { when: 'multiline' }],
// 'react/jsx-tag-spacing' : ['error', { closingSlash: 'never', beforeSelfClosing: 'always' }],
'react/prop-types': [
1,
{
skipUndeclared: true,
},
],
'react/self-closing-comp': 'error',
// 'react/sort-prop-types' : ['error', { ignoreCase: true, sortShapeProp: true }],
},
extends: [
'prettier',
'prettier/react',
'airbnb-base',
'binary',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:jest-dom/recommended',
],
parserOptions: {
requireConfigFile: false,
ecmaVersion: 8,
babelOptions: {
presets: ['@babel/preset-react', '@babel/preset-typescript'],
plugins: [
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: true }],
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
],
},
ecmaFeatures: {
jsx: true,
},
},
settings: {
react: {
version: '16',
},
'import/resolver': {
typescript: {}, // this loads <rootdir>/tsconfig.json to eslint
},
},
extends: ['@deriv/eslint-config-deriv'],
overrides: [
{
files: ['*.ts', '*.tsx'],
Expand Down
Loading

0 comments on commit 42f2247

Please sign in to comment.