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/migrate out of antd #34

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"env": {
"browser": true,
"es2021": true
"es2021": true,
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"next/core-web-vitals"
],
"plugins": ["react", "@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
Expand All @@ -17,17 +19,17 @@
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint"],
"rules": {
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-inferrable-types": "error",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"import/prefer-default-export": "off",
"import/prefer-default-export": "off", // check for relevance here
"eslint-comments/no-use": 0,
"import/no-cycle": "off",
"no-multi-assign": "off",
// "prettier/prettier": "error",
"no-console": 1,
"import/no-extraneous-dependencies": "off",
"import/no-unresolved": "error",
Expand All @@ -37,6 +39,36 @@
"namedComponents": "arrow-function",
"unnamedComponents": "arrow-function"
}
],
"@typescript-eslint/no-non-null-assertion": "off",
"no-restricted-imports": [
"error",
{
"patterns": ["@mui/*/*/*"]
}
],
"max-lines-per-function": ["error", 250],
"max-params": ["error", 3],
"complexity": ["error", 5],
"max-lines": ["error", 350],
"no-else-return": "error",
"require-jsdoc": [
"error",
{
"require": {
"FunctionDeclaration": true,
"MethodDefinition": false,
"ClassDeclaration": false,
"ArrowFunctionExpression": false,
"FunctionExpression": false
}
}
],
"no-shadow": "error",
"no-empty": "error",
"import/order": [
"error",
{ "groups": [["builtin", "external", "internal", "parent", "sibling", "index"]] }
]
}
}
13 changes: 2 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -31,16 +31,7 @@ jobs:

- name: Build Project
run: yarn build

# commenting for now to make CI green , will try this
# - name: run Lighthouse CI
# run: |
# yarn global add @lhci/[email protected]
# lhci autorun --collect.staticDistDir

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/jest-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Jest Coverage Report with Annotations (CI)
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
coverage_report:
name: Jest Coverage Report
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

# could not find the threshold value in jest.config.js
# therefore hardcoded for now
# - name: Get Threshold
# id: threshold
# uses: notiz-dev/github-action-json-property@release
# with:
# path: 'jest.config.js'
# prop_path: 'coverageThreshold.global.statements'

Comment on lines +23 to +31
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider removing the commented-out code related to dynamic threshold fetching or implement it to avoid hardcoding values, which can enhance maintainability.

- name: Install dependencies
run: yarn

- name: Test and generate coverage report
uses: artiomtr/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# threshold: ${{steps.threshold.outputs.prop}}
package-manager: yarn
custom-title: Jest Coverage Report
28 changes: 28 additions & 0 deletions .github/workflows/lighthouseci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
lhci:
name: Lighthouse
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: yarn install and build
run: |
yarn install
yarn build
- name: run Lighthouse CI
run: |
yarn global add @lhci/cli
lhci autorun
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
# next.js
/.next/
/out/
/.swc/
/analyze/


# production
/build
Expand Down Expand Up @@ -45,4 +48,5 @@ yarn-error.log*
/public/workbox-*.js.map
/public/worker-*.js.map
/public/fallback-*.js
reports
reports
.lighthouseci/*
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ An enterprise Next.js template application based on bulletproof architecture sho
- API calls using `api-sauce`
- Styling using `styled-components`
- Reusing components from Ant design
- Translations using `react-intl`
- Translations using `lingui`

## Global state management using @redux/toolkit

Expand Down Expand Up @@ -98,14 +98,13 @@ An enterprise Next.js template application based on bulletproof architecture sho
- [containers/Repos/index.tsx](containers/Repos/index.tsx)
- [features/repos/components/RepoList/index.tsx](features/repos/components/RepoList/index.tsx)

## Localization using react-intl
## Localization using lingui

- Translations using [React Intl](https://github.com/formatjs/react-intl)
- Translations using [Lingui](https://lingui.dev/)

Take a look at the following files

- [translations/en.json](translations/en.json)
- [common/IntlGlobalProvider/index.tsx](common/IntlGlobalProvider/index.tsx)
- [common/T/index.tsx](common/T/index.tsx)
- [features/info/components/RepoInfo/index.tsx](features/info/components/RepoInfo/index.tsx)

Expand Down
31 changes: 0 additions & 31 deletions common/Clickable/index.tsx

This file was deleted.

47 changes: 0 additions & 47 deletions common/For/index.tsx

This file was deleted.

19 changes: 0 additions & 19 deletions common/IntlGlobalProvider/index.tsx

This file was deleted.

68 changes: 0 additions & 68 deletions common/IntlGlobalProvider/tests/index.test.tsx

This file was deleted.

Loading
Loading