Skip to content

Commit

Permalink
Fixed CI
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Apr 25, 2024
1 parent 6ea6f1c commit d47bcc0
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .releaseconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"plugins": ["iobroker", "license", "lerna"],
"ioPackage": "packages/iobroker.vis-2",
"exec": {
"before_commit": "npm run fix-release && npm run build"
"before_commit": "npm run build"
}
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
"npm": "npm run install-monorepo",
"update-packages": "ncu --upgrade && cd package/iobroker.vis-2 && ncu --upgrade && cd package/iobroker.vis-2/src && ncu --upgrade",
"start": "npm run start -w packages/iobroker.vis-2",
"fix-release": "node packages/fixRelease.js",
"release": "release-script",
"release-patch": "release-script patch --yes --no-update-lockfile --publishAll",
"release-minor": "release-script minor --yes --no-update-lockfile --publishAll",
Expand Down
22 changes: 0 additions & 22 deletions packages/fixRelease.js

This file was deleted.

9 changes: 5 additions & 4 deletions packages/iobroker.vis-2/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ function buildRuntime() {
};

const version = JSON.parse(fs.readFileSync(`${__dirname}/package.json`).toString('utf8')).version;
const data = JSON.parse(fs.readFileSync(`${__dirname}/runtime/package.json`).toString('utf8'));
const data = JSON.parse(fs.readFileSync(`${__dirname}/runtime/src/version.json`).toString('utf8'));
if (data.version !== version) {
data.version = version;
fs.writeFileSync(`${__dirname}/runtime/package.json`, JSON.stringify(data, null, 4));
fs.writeFileSync(`${__dirname}/runtime/src/version.json`, JSON.stringify(data, null, 4));
}

console.log(options.cwd);
Expand Down Expand Up @@ -165,6 +165,7 @@ export default FiltersEditorDialog;
fs.writeFileSync(`${__dirname}/runtime/craco.config.js`, fs.readFileSync(`${__dirname}/src/craco.config.js`));
fs.writeFileSync(`${__dirname}/runtime/modulefederation.config.js`, fs.readFileSync(`${__dirname}/src/modulefederation.config.js`));
fs.writeFileSync(`${__dirname}/runtime/src/Editor.jsx`, fs.readFileSync(`${__dirname}/src/src/Runtime.jsx`));
fs.writeFileSync(`${__dirname}/runtime/src/version.json`, fs.readFileSync(`${__dirname}/src/src/version.json`));
fs.writeFileSync(`${__dirname}/runtime/tsconfig.json`, fs.readFileSync(`${__dirname}/src/tsconfig.json`));
fs.writeFileSync(`${__dirname}/runtime/src/Store.tsx`, fs.readFileSync(`${__dirname}/src/src/Store.tsx`));
fs.writeFileSync(`${__dirname}/runtime/src/Utils/utils.tsx`, fs.readFileSync(`${__dirname}/src/src/Utils/utils.tsx`));
Expand Down Expand Up @@ -386,9 +387,9 @@ function build() {
};

const version = JSON.parse(fs.readFileSync(`${__dirname}/package.json`).toString('utf8')).version;
const data = JSON.parse(fs.readFileSync(`${__dirname}/src/package.json`).toString('utf8'));
const data = JSON.parse(fs.readFileSync(`${__dirname}/src/src/version.json`).toString('utf8'));
data.version = version;
fs.writeFileSync(`${__dirname}/src/package.json`, JSON.stringify(data, null, 4));
fs.writeFileSync(`${__dirname}/src/src/version.json`, JSON.stringify(data, null, 4));

console.log(options.cwd);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DragDropContext, Draggable, Droppable } from 'react-beautiful-dnd';


import {
Button,
Dialog, DialogActions,
Expand All @@ -17,7 +16,7 @@ import { Project } from '@/types';
import { getViewsWithDifferentValues } from '@/Attributes/View/ApplyProperties';
import getEditField from '@/Attributes/View/EditField';
import type { Field } from '@/Attributes/View/Items';
import { deepClone } from "@/Utils/utils";
import { deepClone } from '@/Utils/utils';

interface ShowAllViewsDialogProps {
project: Project;
Expand Down Expand Up @@ -165,7 +164,7 @@ export default function showAllViewsDialog(props: ShowAllViewsDialogProps) {
onClick={props.onClose}
// @ts-expect-error grey is valid color
color="grey"
startIcon={<Close/>}
startIcon={<Close />}
>
{I18n.t('Close')}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,7 @@ class Widget extends Component {
}
if (field.type === 'divider') {
return <tr key={fieldIndex} className={this.props.classes.fieldRow}>
// eslint-disable-next-line jsx-a11y/control-has-associated-label
<td colSpan={2} className={this.props.classes.fieldDivider} style={field.style} />
</tr>;
}
Expand Down
8 changes: 4 additions & 4 deletions packages/iobroker.vis-2/src/src/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ class Editor extends Runtime {
});
}
delete project[view.name].widgets[widget];
this.importMarketplaceWidget(
Editor.importMarketplaceWidget(
project,
view.name,
JSON.parse(JSON.stringify(marketplace.widget)),
Expand Down Expand Up @@ -1298,7 +1298,7 @@ class Editor extends Runtime {
await this.changeProject(project);
};

importMarketplaceWidget = (project, view, widgets, id, x, y, widgetId, oldData, oldStyle) => {
static importMarketplaceWidget(project, view, widgets, id, x, y, widgetId, oldData, oldStyle) {
const newWidgets = {};

widgets.forEach(_widget => {
Expand Down Expand Up @@ -1344,12 +1344,12 @@ class Editor extends Runtime {

project[view].widgets = { ...project[view].widgets, ...newWidgets };
return project;
};
}

addMarketplaceWidget = async (id, x, y, widgetId, oldData, oldStyle) => {
const project = deepClone(store.getState().visProject);
const widgets = deepClone(store.getState().visProject.___settings.marketplace.find(item => item.id === id).widget);
this.importMarketplaceWidget(project, this.state.selectedView, widgets, id, x, y, widgetId, oldData, oldStyle);
Editor.importMarketplaceWidget(project, this.state.selectedView, widgets, id, x, y, widgetId, oldData, oldStyle);
await this.changeProject(project);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ export default class BasicSpeechToText extends VisRxWidget<RxData, BasicSpeechTo
super.renderWidgetBody(props);

return <div className="vis-widget-body">
{/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}
<table
style={{ height: '100%', width: '100%' }}
onClick={() => {
Expand All @@ -457,6 +458,7 @@ export default class BasicSpeechToText extends VisRxWidget<RxData, BasicSpeechTo
src={this.state.image}
/>
</td>
{/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}
<td className="mic-text" style={{ width: '100%' }}>
<div
style={{ display: this.state.rxData.noText ? 'none' : undefined }}
Expand Down
12 changes: 5 additions & 7 deletions packages/iobroker.vis-2/src/src/Vis/visRxWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,11 @@ class VisRxWidget<TRxData extends Record<string, any>, TState extends Partial<Vi
});
}

async componentDidMount() {
componentDidMount() {
super.componentDidMount();
for (let i = 0; i < this.linkContext.IDs.length; i++) {
await this.props.context.socket.subscribeState(this.linkContext.IDs[i], this.onIoBrokerStateChanged);
}

this.linkContext.IDs.length && this.props.context.socket.subscribeStateAsync(this.linkContext.IDs, this.onStateChangedBind)
.catch(e => console.error(`Cannot subscribe on ${this.linkContext.IDs}: ${e}`));
}

// eslint-disable-next-line no-unused-vars,class-methods-use-this
Expand All @@ -427,9 +427,7 @@ class VisRxWidget<TRxData extends Record<string, any>, TState extends Partial<Vi

componentWillUnmount() {
if (this.linkContext.IDs.length) {
for (let i = 0; i < this.linkContext.IDs.length; i++) {
this.props.context.socket.unsubscribeState(this.linkContext.IDs[i], this.onIoBrokerStateChanged);
}
this.props.context.socket.unsubscribeState(this.linkContext.IDs, this.onIoBrokerStateChanged);
}
super.componentWillUnmount();
}
Expand Down
2 changes: 1 addition & 1 deletion packages/iobroker.vis-2/src/src/bootstrap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import './index.css';
import { Utils } from '@iobroker/adapter-react-v5';
import App from './Editor';
import * as serviceWorker from './serviceWorker';
import packageJson from '../package.json';
import packageJson from './version.json';
import theme from './theme';

window.adapterName = 'vis-2';
Expand Down
3 changes: 3 additions & 0 deletions packages/iobroker.vis-2/src/src/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"version": "2.9.51"
}

0 comments on commit d47bcc0

Please sign in to comment.