Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/actions/checkout-4
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox authored Jan 21, 2025
2 parents b4ebec5 + 0734488 commit a65ebb3
Show file tree
Hide file tree
Showing 36 changed files with 378 additions and 397 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
- run: npm i --force
Expand All @@ -51,7 +51,7 @@ jobs:
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ dist-ssr
*.sw?
/package-lock.json
/build/
/src/package-lock.json
/src-admin/package-lock.json
/admin/custom
/src/build
/src-admin/build
8 changes: 4 additions & 4 deletions .releaseconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"plugins": ["iobroker", "license"],
"exec": {
"before_commit": "npm run build"
}
"plugins": ["iobroker", "license"],
"exec": {
"before_commit": "npm run build"
}
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 bluefox <[email protected]>
Copyright (c) 2022-2025 bluefox <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Build process creates files in directory build.

All files from `admin/custom` folder must be in adapter admin directory.

To use this component in admin add to jsonConfig.json file:
```
To use this component in admin, add to `jsonConfig.json` file:
```json
"myCustomAttribute": {
"type": "custom",
"i18n": true,
Expand All @@ -17,7 +17,7 @@ To use this component in admin add to jsonConfig.json file:
```

Explanation:
- `AdminComponentTemplateSet` - is unique name of this set of components (see in `src/modulefederation.config.js => name (line 14)`). It is suggested to use adapter name for it.
- `AdminComponentTemplateSet` - is unique name of this set of components (see in `src/modulefederation.config.js => name (line 4)`). It is suggested to use adapter name for it.
- `Components` - file name where all components are (`src/Components.jsx`)
- `ExampleComponent` - name of component in `Components.js`which must be used.
- `i18n` - if set to `true`, so the admin will load language files from `i18n`directory (in the same directory, where `customComponents.js` is), if set to language object, it will be used directly. Example: `{"easyconfig_text": {"en": "Text"}}`.
Expand All @@ -31,6 +31,12 @@ Start in `src`:
### **WORK IN PROGRESS**
-->
## Changelog
### 1.0.2 (2025-01-21)
* (bluefox) Updated example and packages

### 1.0.1 (2024-07-14)
* (bluefox) Changed for Admin 7

### 0.1.6 (2023-05-17)
* (bluefox) Updated packages

Expand All @@ -47,7 +53,7 @@ Start in `src`:
## License
The MIT License (MIT)

Copyright (c) 2022-2023 bluefox <[email protected]>
Copyright (c) 2022-2025 bluefox <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
109 changes: 0 additions & 109 deletions gulpfile.js

This file was deleted.

46 changes: 45 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,47 @@
{
"common": {
"name": "admin-component-template",
"version": "0.1.6",
"version": "1.0.2",
"news": {
"1.0.2": {
"en": "Updated example and packages",
"de": "Beispiel und Pakete aktualisiert",
"ru": "Обновленный пример и пакеты",
"pt": "Exemplo e pacotes atualizados",
"nl": "Bijgewerkt voorbeeld en pakketten",
"fr": "Exemple et paquets mis à jour",
"it": "Esempio e pacchetti aggiornati",
"es": "Ejemplo actualizado y paquetes",
"pl": "Aktualizacja przykładu i pakietów",
"uk": "Оновлений приклад і пакети",
"zh-cn": "更新实例和软件包"
},
"1.0.1": {
"en": "Changed for Admin 7",
"de": "Für Admin 7 geändert",
"ru": "Изменено на Админ 7",
"pt": "Alterado para Admin 7",
"nl": "Gewijzigd voor Admin 7",
"fr": "Change pour l'admin 7",
"it": "Cambiato per Admin 7",
"es": "Cambios en el Admin 7",
"pl": "Zmieniony dla Admin 7",
"uk": "Змінено адміністратора 7",
"zh-cn": "行政7变更"
},
"1.0.0": {
"en": "Changed for Admin 7",
"de": "Für Admin 7 geändert",
"ru": "Изменено на Админ 7",
"pt": "Alterado para Admin 7",
"nl": "Gewijzigd voor Admin 7",
"fr": "Change pour l'admin 7",
"it": "Cambiato per Admin 7",
"es": "Cambios en el Admin 7",
"pl": "Zmieniony dla Admin 7",
"uk": "Змінено адміністратора 7",
"zh-cn": "行政7变更"
},
"0.1.6": {
"en": "Updated packages",
"de": "Aktualisierte Pakete",
Expand Down Expand Up @@ -51,6 +90,11 @@
"authors": [
"bluefox <[email protected]>"
],
"licenseInformation": {
"type": "free",
"license": "MIT"
},
"tier": 3,
"adminUI": {
"config": "json"
},
Expand Down
20 changes: 13 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
{
"name": "iobroker.admin-component-template",
"private": true,
"version": "0.1.6",
"version": "1.0.2",
"scripts": {
"build": "gulp",
"build": "node tasks",
"release": "release-script",
"release-patch": "release-script patch --yes",
"release-minor": "release-script minor --yes",
"release-major": "release-script major --yes",
"update-packages": "ncu --upgrade && cd src && ncu --upgrade && cd .."
"0-clean": "node tasks --0-clean",
"1-npm": "node tasks --1-npm",
"2-build": "node tasks --2-build",
"3-copy": "node tasks --3-copy",
"npm": "npm i -f && cd src-admin && npm i -f",
"update-packages": "npx -y npm-check-updates --upgrade && cd src-admin && npx -y npm-check-updates --upgrade"
},
"dependencies": {},
"devDependencies": {
"@alcalzone/release-script": "^3.6.0",
"@alcalzone/release-script-plugin-iobroker": "^3.6.0",
"@alcalzone/release-script-plugin-license": "^3.5.9",
"gulp": "^4.0.2"
"@alcalzone/release-script": "^3.8.0",
"@alcalzone/release-script-plugin-iobroker": "^3.7.2",
"@alcalzone/release-script-plugin-license": "^3.7.0",
"@iobroker/build-tools": "^2.0.14",
"@iobroker/eslint-config": "^1.0.0"
}
}
3 changes: 3 additions & 0 deletions prettier.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import prettierConfig from '@iobroker/eslint-config/prettier.config.mjs';

export default prettierConfig;
7 changes: 2 additions & 5 deletions src/craco.config.js → src-admin/craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@ const { ProvidePlugin } = require('webpack');
const cracoModuleFederation = require('@iobroker/adapter-react-v5/craco-module-federation');

module.exports = {
plugins: [
{ plugin: CracoEsbuildPlugin },
{ plugin: cracoModuleFederation, options: { useNamedChunkIds: true } }
],
plugins: [{ plugin: CracoEsbuildPlugin }, { plugin: cracoModuleFederation, options: { useNamedChunkIds: true } }],
devServer: {
proxy: {
'/files': 'http://127.0.0.1:8081',
'/adapter': 'http://127.0.0.1:8081',
'/session': 'http://127.0.0.1:8081',
'/log': 'http://127.0.0.1:8081',
'/lib': 'http://127.0.0.1:8081',
}
},
},
webpack: {
output: {
Expand Down
10 changes: 10 additions & 0 deletions src-admin/modulefederation.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { shared } = require('@iobroker/adapter-react-v5/modulefederation.admin.config');

module.exports = {
name: 'AdminComponentTemplateSet',
filename: 'customComponents.js',
exposes: {
'./Components': './src/Components.jsx',
},
shared,
};
43 changes: 43 additions & 0 deletions src-admin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "iobroker-admin-component-easy-access",
"private": true,
"version": "1.0.1",
"scripts": {
"start": "set PORT=4173 && craco start",
"build": "craco build"
},
"dependencies": {},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@iobroker/adapter-react-v5": "^7.4.14",
"@iobroker/json-config": "^7.4.14",
"@mui/material": "^6.4.0",
"prop-types": "^15.8.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-scripts": "^5.0.1",
"react-refresh": "^0.16.0",
"@originjs/vite-plugin-federation": "^1.3.9",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-node-resolve": "^16.0.0",
"@rollup/plugin-replace": "^6.0.2",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"@craco/craco": "^7.1.0",
"craco-esbuild": "^0.6.1",
"craco-module-federation": "^1.1.0"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Loading

0 comments on commit a65ebb3

Please sign in to comment.