Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/actions/setup-node-4
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox authored Oct 11, 2024
2 parents b1e7573 + c1d1849 commit a4328fb
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 169 deletions.
26 changes: 3 additions & 23 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- run: npm i --force
- run: NODE_OPTIONS=--max_old_space_size=4096 npm run build

Expand All @@ -42,18 +42,15 @@ jobs:
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]

steps:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Extract the version and commit body from the tag
id: extract_release
Expand Down Expand Up @@ -93,20 +90,3 @@ jobs:
# Prerelease versions create pre-releases on GitHub
prerelease: ${{ contains(steps.extract_release.outputs.VERSION, '-') }}
body: ${{ steps.extract_release.outputs.BODY }}

#- name: Notify Sentry.io about the release
# run: |
# npm i -g @sentry/cli
# export SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
# export SENTRY_URL=https://sentry.iobroker.net
# export SENTRY_ORG=iobroker
# export SENTRY_PROJECT=iobroker-admin
# export SENTRY_VERSION=iobroker.admin@${{ steps.extract_release.outputs.VERSION }}
# sentry-cli releases new $SENTRY_VERSION
# sentry-cli releases finalize $SENTRY_VERSION

# Add the following line BEFORE finalize if repositories are connected in Sentry
# sentry-cli releases set-commits $SENTRY_VERSION --auto

# Add the following line BEFORE finalize if sourcemap uploads are needed
# sentry-cli releases files $SENTRY_VERSION upload-sourcemaps build/
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Explanation:
### **WORK IN PROGRESS**
-->
## Changelog
### 1.0.3 (2024-10-11)
* (bluefox) Replaced `@iobroker/adapter-react-v5` with `@iobroker/react-components`

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

Expand Down
2 changes: 1 addition & 1 deletion craco.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const CracoEsbuildPlugin = require('craco-esbuild');
const { ProvidePlugin } = require('webpack');
const cracoModuleFederation = require('@iobroker/adapter-react-v5/craco-module-federation');
const cracoModuleFederation = require('@iobroker/react-components/craco-module-federation');

module.exports = {
plugins: [
Expand Down
112 changes: 0 additions & 112 deletions gulpfile.js

This file was deleted.

2 changes: 1 addition & 1 deletion modulefederation.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { shared } = require('@iobroker/adapter-react-v5/modulefederation.admin.config');
const { shared } = require('@iobroker/react-components/modulefederation.admin.config');

module.exports = {
name: 'AdminComponentEasyAccessSet',
Expand Down
28 changes: 16 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"name": "iobroker-admin-component-easy-access",
"private": true,
"version": "1.0.1",
"version": "1.0.3",
"scripts": {
"start": "set PORT=4173 && craco start",
"lint": "eslint --fix --ext .js,.jsx src",
"webpack-build": "craco build",
"build": "gulp",
"build": "node tasks",
"0-clean": "node tasks --0-clean",
"1-npm": "node tasks --1-npm",
"2-compile": "node tasks --2-compile",
"3-copy": "node tasks --3-copy",
"prepublishOnly": "echo Run publish in dist && exit 1",
"release": "release-script",
"release-patch": "release-script patch --yes",
Expand All @@ -15,22 +19,22 @@
},
"dependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@alcalzone/release-script": "^3.7.3",
"@alcalzone/release-script": "^3.8.0",
"@alcalzone/release-script-plugin-license": "^3.7.0",
"@iobroker/adapter-react-v5": "^6.0.19",
"@iobroker/json-config": "^7.0.13",
"@mui/material": "^5.16.1",
"@iobroker/build-tools": "^2.0.6",
"@iobroker/react-components": "^7.2.5",
"@iobroker/json-config": "^7.2.5",
"@mui/material": "^6.1.3",
"prop-types": "^15.8.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-scripts": "^5.0.1",
"gulp": "^4.0.2",
"@originjs/vite-plugin-federation": "^1.3.5",
"@originjs/vite-plugin-federation": "^1.3.6",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.7",
"@types/react": "^18.3.3",
"@rollup/plugin-commonjs": "^28.0.0",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-replace": "^6.0.1",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0"
},
"devDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions src/ConfigCustomEasyAccess.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import {

// important to make from package and not from some children.
// invalid
// import ConfigGeneric from '@iobroker/adapter-react-v5/ConfigGeneric';
// import ConfigGeneric from '@iobroker/react-components/ConfigGeneric';
// valid
import { ConfigGeneric } from '@iobroker/json-config';
import { i18n } from '@iobroker/adapter-react-v5';
import { I18n } from '@iobroker/react-components';

const styles = {
table: {
Expand Down Expand Up @@ -59,9 +59,9 @@ class ConfigCustomEasyAccess extends ConfigGeneric {
<Table style={styles.table} size="small">
<TableHead>
<TableRow>
<TableCell style={styles.header}>{i18n.t('custom_easy_Instance')}</TableCell>
<TableCell style={styles.header}>{i18n.t('custom_easy_Config')}</TableCell>
<TableCell style={styles.header}>{i18n.t('custom_easy_Tab')}</TableCell>
<TableCell style={styles.header}>{I18n.t('custom_easy_Instance')}</TableCell>
<TableCell style={styles.header}>{I18n.t('custom_easy_Config')}</TableCell>
<TableCell style={styles.header}>{I18n.t('custom_easy_Tab')}</TableCell>
</TableRow>
</TableHead>
<TableBody>
Expand Down
14 changes: 0 additions & 14 deletions src/package-lock.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@iobroker/admin-component-easy-access",
"version": "1.0.1",
"version": "1.0.3",
"description": "Admin JSON config component",
"author": {
"name": "bluefox",
Expand Down
Empty file removed src/public
Empty file.
48 changes: 48 additions & 0 deletions tasks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
const { deleteFoldersRecursive, npmInstall, buildReact, copyFiles } = require('@iobroker/build-tools');

function copyAllFiles() {
copyFiles(['build/static/js/*.js'], 'dist/admin/custom/static/js');
copyFiles(['build/customComponents.js'], 'dist/admin/custom');
copyFiles(['build/customComponents.js.map'], 'dist/admin/custom');
copyFiles(['build/static/js/*.map'], 'dist/admin/custom/static/js');
copyFiles(['src/i18n/*.json'], 'dist/admin/custom/i18n');
copyFiles(['img/*'], 'dist/img');
copyFiles(['README.md', 'LICENSE'], 'dist');
copyFiles(['src/package.json'], 'dist');
}

function build() {
const pack = require(`${__dirname}/package.json`);
const packSrc = require(`${__dirname}/src/package.json`);
packSrc.version = pack.version;
require('fs').writeFileSync(`${__dirname}/src/package.json`, JSON.stringify(packSrc, null, 4));
return buildReact(__dirname, { rootDir: __dirname, craco: true, exec: true });
}

if (process.argv.includes('--0-clean')) {
deleteFoldersRecursive(`${__dirname}/admin`, ['admin-component-template.png', 'jsonConfig.json']);
deleteFoldersRecursive(`${__dirname}/src/build`);
} else if (process.argv.includes('--1-npm')) {
npmInstall(__dirname).catch(e => {
console.error(`Cannot install packages: ${e}`);
process.exit(1);
});
} else if (process.argv.includes('--2-compile')) {
build()
.catch(e => {
console.error(`Cannot compile: ${e}`);
process.exit(1);
});
} else if (process.argv.includes('--3-copy')) {
copyAllFiles();
} else {
deleteFoldersRecursive(`${__dirname}/dist`);
deleteFoldersRecursive(`${__dirname}/build`);
npmInstall(__dirname)
.then(() => build())
.then(() => copyAllFiles())
.catch(e => {
console.error(`Cannot build: ${e}`);
process.exit(1);
});
}

0 comments on commit a4328fb

Please sign in to comment.