Skip to content

Commit

Permalink
Use vite for build
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Jan 15, 2025
1 parent dacf6c5 commit 34bbc13
Show file tree
Hide file tree
Showing 31 changed files with 847 additions and 689 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

47 changes: 0 additions & 47 deletions .eslintrc.json

This file was deleted.

2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

9 changes: 0 additions & 9 deletions .prettierrc.js

This file was deleted.

14 changes: 7 additions & 7 deletions DEBUGGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

## Local Debugging

To test the repochecker and debug into the script under vscode:
To test the adapter-checker and debug into the script under vscode:

1. Clone the repository to your local machine.\
Best is that the directory is on the same level than your adapter repository.
Best is that the directory is on the same level as your adapter repository.

2. run npm install in the repochecker directory.
2. run npm install in the adapter-checker directory.

3. switch to your adapter repository and create a new launch configuration:

```json5
{
"name": "Launch Program",
"program": "../iobroker.repochecker/index.js", // path to the repochecker repo
"program": "../iobroker.repochecker/index.js", // path to the adapter checker repo
// args as entered on the commandline, arguments as a array
"args": ["https://github.com/klein0r/ioBroker.luftdaten","--local"],
"request": "launch",
Expand All @@ -29,12 +29,12 @@ To test the repochecker and debug into the script under vscode:

## Local Testing without debugging

To test the repochecker under vscode:
To test the adapter checker under vscode:

1. Clone the repository to your local machine.\
Best is that the directory is on the same level than your adapter repository.
Best is that the directory is on the same level as your adapter repository.

2. run npm install in the repochecker directory.
2. run npm install in the adapter checker directory.

3. switch to your adapter repository and enter the following commandline in a new terminal

Expand Down
27 changes: 27 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import config from '@iobroker/eslint-config';

export default [
...config,
{
languageOptions: {
parserOptions: {
allowDefaultProject: {
allow: ['*.js', '*.mjs'],
},
tsconfigRootDir: import.meta.dirname,
project: './tsconfig.json',
// projectService: true,
},
},
},
{
// disable temporary the rule 'jsdoc/require-param' and enable 'jsdoc/require-jsdoc'
rules: {
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param': 'off',
},
},
{
ignores: ['build-backend/**/*', 'lib/**/*'],
},
];
34 changes: 34 additions & 0 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import config, { reactConfig } from '@iobroker/eslint-config';

export default [
...config,
...reactConfig,
{
rules: {
'no-new-func': 'warn',
'no-extend-native': 'warn',
'no-eval': 'warn',
},
},
{
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ['*.mjs'],
},
tsconfigRootDir: import.meta.dirname,
},
},
},
{
// disable temporary the rule 'jsdoc/require-param' and enable 'jsdoc/require-jsdoc'
rules: {
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param': 'off',
'@/no-duplicate-imports': 'error',
},
},
{
ignores: ['build/**/*', 'node_modules/**/*', 'src/serviceWorker.js', 'vite.config.mjs'],
},
];
31 changes: 31 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link
rel="shortcut icon"
href="favicon.ico"
/>
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta
name="theme-color"
content="#000000"
/>
<link
rel="manifest"
href="manifest.json"
/>
<script>
window.API_URL = '${API_URL}';
</script>
<title>ioBroker Adapter checker</title>
</head>
<body>
<noscript> You need to enable JavaScript to run this app. </noscript>
<div id="root"></div>
<script type="module" src="src/index.jsx"></script>
</body>
</html>
58 changes: 28 additions & 30 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
{
"name": "frontend-user",
"version": "0.1.0",
"private": true,
"dependencies": {
"@iobroker/adapter-react-v5": "^4.0.2",
"@mui/material": "^5.10.17",
"@mui/icons-material": "^5.10.16",
"@mui/styles": "^5.10.16",
"babel-eslint": "^10.1.0",
"react-moment": "^1.1.2",
"moment": "^2.29.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "^5.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
"name": "frontend-user",
"version": "0.1.0",
"private": true,
"dependencies": {
"@iobroker/adapter-react-v5": "^7.4.14",
"@mui/material": "^6.4.0",
"@mui/icons-material": "^6.4.0",
"@vitejs/plugin-react": "^4.3.4",
"react-moment": "^1.1.3",
"moment": "^2.30.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"scripts": {
"start": "vite",
"build": "vite build",
"lint": "eslint -c eslint.config.mjs",
"npm": "npm i --force"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
20 changes: 0 additions & 20 deletions frontend/public/index.html

This file was deleted.

26 changes: 13 additions & 13 deletions frontend/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"short_name": "Repo checker",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
"short_name": "Adapter checker",
"name": "ioBroker Adapter checker",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
2 changes: 0 additions & 2 deletions frontend/src/App.css

This file was deleted.

Loading

0 comments on commit 34bbc13

Please sign in to comment.