Skip to content

Commit

Permalink
Merge pull request #188 from pastelnetwork/feature/add-multi-languages
Browse files Browse the repository at this point in the history
add multi languages
  • Loading branch information
Dicklesworthstone authored Mar 17, 2023
2 parents c91b069 + bc1c707 commit 79e6e20
Show file tree
Hide file tree
Showing 364 changed files with 15,931 additions and 4,010 deletions.
15 changes: 15 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "10"
}
}
]
],
"plugins": [
["macros"]
]
}
47 changes: 41 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,40 @@

---

## Project Structure
```
Project Root
├── "configuration-files"
├── public
│ └── static
└── src
├── components
│ └── pascal-case-component-name
│ ├── PascalCaseComponent.tsx
| └── PascalCaseComponent.styles.ts
└── pages
└── pascal-case-page-name
├── PascalCasePage.tsx
├── PascalCasePage.helpers.tsx
└── PascalCasePage.styles.ts
```

## Naming Conventions

- Use PascalCase to name React Components (put them into `src/components/` structure), and
`export default` an unnamed component
- Use PascalCase to
name the pages (put them into `src/pages/` structure)
- Use camelCase to name variables, constants, functions, and methods
- Use PascalCase to name classes
- Use a single underscore in front of a method name to indicate private (non-public) methods

## Development


## Run Frontend for Development

Make dot env file from the example one.

Expand All @@ -32,12 +64,15 @@ Run the app in the development mode.
yarn start
```

Run tests.

```bash
yarn test
```

## Production Deployment

Make sure you use the proper env variables when building the app in the CI/CD pipeline.

## Run Tests

To run the type check and unit tests, use the following command:

```bash
yarn test
```
16 changes: 16 additions & 0 deletions babel-plugin-macros.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
presets: [
[
"@babel/preset-env",
{
targets: {
node: "10"
}
}
]
],
plugins: ["macros"],
styledComponents: {
pure: true,
},
}
8 changes: 8 additions & 0 deletions jest-setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const { TextDecoder, TextEncoder } = require('util');
const Enzyme = require('enzyme');
const Adapter = require('@wojtekmaj/enzyme-adapter-react-17');

Enzyme.configure({ adapter: new Adapter() });

global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;
45 changes: 45 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module.exports = {
roots: [
"<rootDir>/src"
],
globals: {
'ts-jest': {
babelConfig: '.babelrc',
},
},
transform: {
"^.+\\.(ts|tsx)$": "ts-jest"
},
testMatch: [
"**/__tests__/**/*.+(ts|tsx|js)",
"**/?(*.)+(spec|test).+(ts|tsx|js)"
],
moduleFileExtensions: [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
],
moduleNameMapper: {
'\\.(css|less)$': '<rootDir>/tools/cssModuleMock.js',
'\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/tools/fileMock.js',
'@pages/(.*)': '<rootDir>/src/pages/$1',
'@components/(.*)': '<rootDir>/src/components/$1',
'@assets/(.*)': '<rootDir>/src/assets/$1',
'@theme/(.*)': '<rootDir>/src/theme/$1',
'@utils/(.*)': '<rootDir>/src/utils/$1',
'@redux/(.*)': '<rootDir>/src/redux/$1',
'@routes/(.*)': '<rootDir>/src/routes/$1',
'@layouts/(.*)': '<rootDir>/src/layouts/$1',
'@hooks/(.*)': '<rootDir>/src/hooks/$1',
'@context/(.*)': '<rootDir>/src/context/$1',
'@apis/(.*)': '<rootDir>/src/apis/$1',
'@services/(.*)': '<rootDir>/src/services/$1',
},
moduleDirectories: ['node_modules', 'src'],
testEnvironment: "jsdom",
setupFiles: [`<rootDir>/jest-setup.js`],
}
69 changes: 38 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preinstall": "node -e \"if (process.env.npm_execpath.indexOf('yarn') === -1) throw new Error('Use yarn for installing: https://yarnpkg.com/en/docs/install')\"",
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"test": "jest",
"eject": "react-app-rewired eject",
"lint": "eslint \"src/**/*.{ts,tsx}\"",
"lint:fix": "yarn lint --fix"
Expand All @@ -30,69 +30,72 @@
"@babel/preset-env": "7.14.1",
"@date-io/core": "1.3.13",
"@date-io/date-fns": "1.3.13",
"@loadable/component": "^5.15.2",
"@loadable/component": "5.15.2",
"@material-ui/core": "4.11.4",
"@material-ui/icons": "4.11.2",
"@material-ui/lab": "4.0.0-alpha.58",
"@material-ui/pickers": "3.3.10",
"@material-ui/styles": "4.11.4",
"@material-ui/system": "4.11.3",
"@types/react-router-dom": "^5.3.3",
"@types/react-router-dom": "5.3.3",
"axios": "0.21.2",
"chart.js": "3.2.1",
"css-vendor": "2.0.8",
"date-fns": "2.21.2",
"echarts": "^5.1.1",
"echarts-for-react": "^3.0.1",
"file-saver": "^2.0.5",
"fzstd": "^0.1.0",
"html-react-parser": "^3.0.4",
"html-to-image": "^1.6.2",
"js-base64": "^3.7.3",
"echarts": "5.1.1",
"echarts-for-react": "3.0.1",
"file-saver": "2.0.5",
"fzstd": "0.1.0",
"html-react-parser": "3.0.4",
"html-to-image": "1.6.2",
"i18next": "22.4.10",
"i18next-http-backend": "2.1.1",
"js-base64": "3.7.3",
"jss": "10.6.0",
"lodash.debounce": "^4.0.8",
"lzutf8": "^0.6.3",
"lodash.debounce": "4.0.8",
"lzutf8": "0.6.3",
"polished": "4.1.2",
"react": "17.0.2",
"react-chartjs-2": "3.0.3",
"react-csv": "^2.0.3",
"react-csv": "2.0.3",
"react-datepicker": "4.10.0",
"react-dom": "17.0.2",
"react-helmet-async": "1.0.9",
"react-i18next": "12.2.0",
"react-jvectormap": "0.0.16",
"react-paginate": "^8.1.4",
"react-paginate": "8.1.4",
"react-perfect-scrollbar": "1.5.8",
"react-redux": "7.2.4",
"react-router-dom": "5.2.0",
"react-scripts": "4.0.3",
"react-syntax-highlighter": "15.4.3",
"react-virtualized": "^9.22.3",
"react-virtualized": "9.22.3",
"redux": "4.1.0",
"redux-persist": "6.0.0",
"redux-thunk": "2.3.0",
"socket.io-client": "^4.1.3",
"socket.io-client": "4.1.3",
"styled-components": "5.3.0",
"swr": "^2.0.0"
"swr": "2.0.0"
},
"devDependencies": {
"@types/dragula": "3.7.0",
"@types/file-saver": "^2.0.2",
"@types/loadable__component": "^5.13.4",
"@types/lodash.debounce": "^4.0.6",
"@types/node": "^16.6.1",
"@types/enzyme": "3.10.12",
"@types/file-saver": "2.0.2",
"@types/jest": "26.0.24",
"@types/loadable__component": "5.13.4",
"@types/lodash.debounce": "4.0.6",
"@types/node": "16.6.1",
"@types/react": "17.0.5",
"@types/react-csv": "^1.1.1",
"@types/react-csv": "1.1.1",
"@types/react-datepicker": "4.8.0",
"@types/react-dom": "17.0.3",
"@types/react-helmet": "6.1.1",
"@types/react-paginate": "^7.1.1",
"@types/react-paginate": "7.1.1",
"@types/react-redux": "7.1.16",
"@types/react-responsive-masonry": "^2.1.0",
"@types/react-syntax-highlighter": "13.5.0",
"@types/react-virtualized": "^9.21.11",
"@types/react-virtualized": "9.21.11",
"@types/redux-mock-store": "1.0.3",
"@types/styled-components": "5.1.9",
"@typescript-eslint/eslint-plugin": "^4.22.1",
"@typescript-eslint/parser": "^4.22.1",
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
"axios-mock-adapter": "1.21.2",
"enzyme": "3.11.0",
"eslint": "^7.25.0",
"eslint-config-airbnb": "18.2.1",
"eslint-config-prettier": "^8.3.0",
Expand All @@ -101,11 +104,15 @@
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.23.1",
"eslint-plugin-react-hooks": "^4.2.0",
"prettier": "^2.2.1",
"jest": "26.6.0",
"jest-styled-components": "7.1.1",
"prettier": "2.2.1",
"prop-types": "15.7.2",
"react-app-rewire-alias": "^1.0.3",
"react-app-rewired": "^2.1.8",
"redux-devtools-extension": "2.13.9",
"redux-mock-store": "1.5.4",
"ts-jest": "26.5.6",
"typescript": "4.2.4"
},
"resolutions": {
Expand Down
Loading

0 comments on commit 79e6e20

Please sign in to comment.