-
Notifications
You must be signed in to change notification settings - Fork 23
feat: add lingui support and vite to openyurt #62
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d794888
feat: add lingui support and vite support to openyurt
karanngi 81d55c9
add more files for translation
karanngi 1eb127d
add more files for translation
karanngi d751a03
feat: default language for codebase English
karanngi 16c2941
typo change OpenYurt Experience Center -> OpenYurt
karanngi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| module.exports = { | ||
| env: { | ||
| browser: true, | ||
| es2021: true, | ||
| node: true, | ||
| jest: true, | ||
| }, | ||
| extends: [ | ||
| 'eslint:recommended', | ||
| 'plugin:react/recommended', | ||
| 'plugin:react-hooks/recommended', | ||
| 'plugin:jsx-a11y/recommended', | ||
| 'plugin:import/recommended', | ||
| 'prettier', | ||
| ], | ||
| parserOptions: { | ||
| ecmaFeatures: { | ||
| jsx: true, | ||
| }, | ||
| ecmaVersion: 12, | ||
| sourceType: 'module', | ||
| }, | ||
| plugins: ['react', 'react-hooks', 'jsx-a11y', 'import'], | ||
| settings: { | ||
| react: { | ||
| version: '17.0.2', // Specify your React version here | ||
| }, | ||
| 'import/resolver': { | ||
| node: { | ||
| extensions: ['.js', '.jsx'], | ||
| }, | ||
| }, | ||
| }, | ||
| rules: { | ||
| 'no-console': 'warn', | ||
| 'no-unused-vars': 'warn', | ||
| 'no-undef': 'error', | ||
| 'no-var': 'error', | ||
| 'prefer-const': 'error', | ||
|
|
||
| 'react/prop-types': 'off', | ||
| 'react/react-in-jsx-scope': 'off', | ||
| 'react/jsx-uses-react': 'off', | ||
| 'react/jsx-key': 'error', | ||
| 'react/jsx-no-target-blank': 'error', | ||
| 'react/no-deprecated': 'error', | ||
|
|
||
| 'react-hooks/rules-of-hooks': 'error', | ||
| 'react-hooks/exhaustive-deps': 'warn', | ||
|
|
||
| 'jsx-a11y/anchor-is-valid': [ | ||
| 'error', | ||
| { | ||
| components: ['Link'], | ||
| specialLink: ['hrefLeft', 'hrefRight'], | ||
| aspects: ['invalidHref', 'preferButton'], | ||
| }, | ||
| ], | ||
|
|
||
| 'import/no-unresolved': 'error', | ||
| 'import/named': 'error', | ||
| 'import/namespace': 'error', | ||
| 'import/default': 'error', | ||
| 'import/export': 'error', | ||
| 'import/order': [ | ||
| 'warn', | ||
| { | ||
| groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], | ||
| 'newlines-between': 'always', | ||
| alphabetize: { | ||
| order: 'asc', | ||
| caseInsensitive: true, | ||
| }, | ||
| }, | ||
| ], | ||
| }, | ||
| overrides: [ | ||
| { | ||
| files: ['**/*.test.js', '**/*.test.jsx'], | ||
| env: { | ||
| jest: true, | ||
| }, | ||
| }, | ||
| ], | ||
| }; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Logs | ||
| logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
| lerna-debug.log* | ||
|
|
||
| node_modules | ||
| dist | ||
| dist-ssr | ||
| *.local | ||
|
|
||
| # Editor directories and files | ||
| .vscode/* | ||
| !.vscode/extensions.json | ||
| .idea | ||
| .DS_Store | ||
| *.suo | ||
| *.ntvs* | ||
| *.njsproj | ||
| *.sln | ||
| *.sw? | ||
|
|
||
| # Environment variables | ||
| .env.local | ||
| .env.development.local | ||
| .env.test.local | ||
| .env.production.local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,40 +1,82 @@ | ||
| # Getting Started | ||
| # OpenYurt | ||
|
|
||
| This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). | ||
| This is the frontend application for the OpenYurt, built with Vite + React. | ||
|
|
||
| ## Available Scripts | ||
| ## Features | ||
|
|
||
| In the project directory, you can run: | ||
| - Modern development environment with Vite | ||
| - React 18 with hooks | ||
| - Ant Design for UI components | ||
| - React Router v6 for routing | ||
| - Lingui for internationalization | ||
| - TypeScript support | ||
|
|
||
| ### `npm start` | ||
| ## Getting Started | ||
|
|
||
| Runs the app in the development mode.\ | ||
| Open [http://localhost:3000](http://localhost:3000) to view it in the browser. | ||
| ### Prerequisites | ||
|
|
||
| The page will reload if you make edits.\ | ||
| You will also see any lint errors in the console. | ||
| - Node.js 16.x or later | ||
| - npm 7.x or later | ||
|
|
||
| ### `npm test` | ||
| ### Installation | ||
|
|
||
| Launches the test runner in the interactive watch mode.\ | ||
| See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. | ||
| 1. Clone the repository | ||
| 2. Install dependencies: | ||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| ### `npm run build` | ||
| ### Development | ||
|
|
||
| Builds the app for production to the `build` folder.\ | ||
| It correctly bundles React in production mode and optimizes the build for the best performance. | ||
| To start the development server: | ||
|
|
||
| The build is minified and the filenames include the hashes.\ | ||
| Your app is ready to be deployed! | ||
| ```bash | ||
| npm run dev | ||
| ``` | ||
|
|
||
| See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. | ||
| The application will be available at http://localhost:3000. | ||
|
|
||
| ### `npm run eject` | ||
| ### Building for Production | ||
|
|
||
| **Note: this is a one-way operation. Once you `eject`, you can’t go back!** | ||
| To build the application for production: | ||
|
|
||
| If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. | ||
| ```bash | ||
| npm run build | ||
| ``` | ||
|
|
||
| Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. | ||
| The built files will be in the `dist` directory. | ||
|
|
||
| You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. | ||
| ### Linting and Formatting | ||
|
|
||
| To check for linting errors: | ||
|
|
||
| ```bash | ||
| npm run lint | ||
| ``` | ||
|
|
||
| To format the code: | ||
|
|
||
| ```bash | ||
| npm run format | ||
| ``` | ||
|
|
||
| ## Project Structure | ||
|
|
||
| ``` | ||
| src/ | ||
| ├── assets/ # Static assets | ||
| ├── components/ # React components | ||
| ├── constants/ # Constants and configuration | ||
| ├── utils/ # Utility functions | ||
| ├── locales/ # Internationalization files | ||
| ├── App.jsx # Main application component | ||
| └── main.jsx # Application entry point | ||
| ``` | ||
|
|
||
| ## Contributing | ||
|
|
||
| Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests. | ||
|
|
||
| ## License | ||
|
|
||
| This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
|
|
||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <link rel="icon" type="image/png" href="/OpenYurt.png" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>OpenYurt</title> | ||
| </head> | ||
|
|
||
| <body> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/main.jsx"></script> | ||
| </body> | ||
|
|
||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
|
|
||
| export default { | ||
| locales: ['en', 'zh'], | ||
| sourceLocale: 'en', | ||
| catalogs: [ | ||
| { | ||
| path: '<rootDir>/src/locales/{locale}/messages', | ||
| include: ['src'], | ||
| }, | ||
| ], | ||
| compileNamespace: 'es' | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the exposed port has been changed. The declaration in yaml should also be changed
yurt-dashboard/charts/yurt-dashboard/templates/deployment.yaml
Line 24 in 9ab2df2