Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Bump i18next from 21.10.0 to 26.3.6 (#3068)

dependabot[bot]91a5980d78b0
diff --git a/package.json b/package.json
index 812c7f2db..ce4b9f7a2 100644
--- a/package.json
+++ b/package.json
@@ -27,6 +27,6 @@
"eslint-plugin-promise": "6.6.0",
"eslint-plugin-wc": "3.1.0",
"prettier": "3.9.6",
- "typescript": "5.8.3"
+ "typescript": "~5.9.3"
}
}
diff --git a/ui/component/core/package.json b/ui/component/core/package.json
index 88931d51d..6250d3f07 100644
--- a/ui/component/core/package.json
+++ b/ui/component/core/package.json
@@ -26,7 +26,7 @@
"@openremote/or-icon": "workspace:*",
"@openremote/rest": "workspace:*",
"axios": "1.20.0",
- "i18next": "^21.5.3",
+ "i18next": "^26.3.6",
"i18next-http-backend": "^4.0.0",
"keycloak-js": "^25.0.1",
"lodash.transform": "^4.6.0",
diff --git a/ui/component/core/src/asset-mixin.ts b/ui/component/core/src/asset-mixin.ts
index f34d7e15e..d3cd8d643 100644
--- a/ui/component/core/src/asset-mixin.ts
+++ b/ui/component/core/src/asset-mixin.ts
@@ -23,14 +23,14 @@ import { Util } from ".";
declare type Constructor<T = {}> = new (...args: any[]) => T;
-interface CustomElement {
+export interface CustomElement {
requestUpdate(name?: PropertyKey, oldValue?: unknown): void;
connectedCallback?(): void;
disconnectedCallback?(): void;
readonly isConnected: boolean;
}
-export const subscribe =
+const subscribeMixin =
(eventProviderFactory: EventProviderFactory) =>
<T extends Constructor<CustomElement>>(base: T) =>
class extends base {
@@ -38,7 +38,6 @@ export const subscribe =
public _subscriptionIds?: string[];
public _assetIds?: string[];
public _attributeRefs?: AttributeRef[];
- public _status: EventProviderStatus = EventProviderStatus.DISCONNECTED;
public _statusCallback = (status: EventProviderStatus) => this._onEventProviderStatusChanged(status);
connectedCallback() {
@@ -219,3 +218,14 @@ export const subscribe =
// noinspection JSUnusedLocalSymbols
public _onEvent(event: SharedEvent) {}
};
+
+/**
+ * Instance API that {@link subscribe} adds to the base class, derived from the mixin so it cannot
+ * drift from the implementation.
+ */
+export interface SubscribedElement extends InstanceType<ReturnType<ReturnType<typeof subscribeMixin>>> {}
+
+export const subscribe =
+ (eventProviderFactory: EventProviderFactory) =>
+ <T extends Constructor<CustomElement>>(base: T): T & Constructor<SubscribedElement> =>
+ subscribeMixin(eventProviderFactory)(base);
diff --git a/ui/component/or-asset-viewer/package.json b/ui/component/or-asset-viewer/package.json
index 242d6705e..ac6f9a559 100644
--- a/ui/component/or-asset-viewer/package.json
+++ b/ui/component/or-asset-viewer/package.json
@@ -41,7 +41,7 @@
"@openremote/or-mwc-components": "workspace:*",
"@openremote/or-translate": "workspace:*",
"@openremote/or-vaadin-components": "workspace:*",
- "i18next": "^21.5.3",
+ "i18next": "^26.3.6",
"lit": "^3.3.1"
},
"devDependencies": {
diff --git a/ui/component/or-asset-viewer/src/index.ts b/ui/component/or-asset-viewer/src/index.ts
index a8de158f4..88acf9770 100644
--- a/ui/component/or-asset-viewer/src/index.ts
+++ b/ui/component/or-asset-viewer/src/index.ts
@@ -56,7 +56,7 @@ import {
WellknownMetaItems,
} from "@openremote/model";
import { panelStyles, style } from "./style";
-import i18next, { type InitOptions, type TOptions } from "i18next";
+import i18next, { type TOptions } from "i18next";
import { styleMap } from "lit/directives/style-map.js";
import { classMap } from "lit/directives/class-map.js";
import type { GenericAxiosResponse } from "axios";
@@ -1571,7 +1571,7 @@ export class OrAssetViewer extends subscribe(manager)(translate(i18next)(OrEleme
)}
</div>
<div id="right-wrapper" class="mobileHidden">
- ${validationErrors.length === 0 ? (asset!.createdOn ? html`<or-translate id="created-time" class="tabletHidden" value="createdOnWithDate" .options="${{ date: new Date(asset!.createdOn!) } as TOptions<InitOptions>}"></or-translate>` : ``) : html`<span id="error-wrapper" .title="${validationErrors.join("\n")}"><or-icon icon="alert"></or-icon><or-translate class="tabletHidden" value="validation.invalidAsset"></or-translate></span>`}
+ ${validationErrors.length === 0 ? (asset!.createdOn ? html`<or-translate id="created-time" class="tabletHidden" value="createdOnWithDate" .options="${{ date: new Date(asset!.createdOn!) } as TOptions}"></or-translate>` : ``) : html`<span id="error-wrapper" .title="${validationErrors.join("\n")}"><or-icon icon="alert"></or-icon><or-translate class="tabletHidden" value="validation.invalidAsset"></or-translate></span>`}
${when(
editMode,
() => html`
diff --git a/ui/component/or-scheduler/src/index.ts b/ui/component/or-scheduler/src/index.ts
index e59044ef6..ede5475a1 100644
--- a/ui/component/or-scheduler/src/index.ts
+++ b/ui/component/or-scheduler/src/index.ts
@@ -216,8 +216,8 @@ export class OrScheduler extends translate(i18next)(OrElement) {
template = html`<or-translate value="fromTo" .options="${fromTo}"></or-translate>`;
}
const fromToTemplate = html`<span>&nbsp;${template}</span>`;
- const monthNames = Object.values(MONTHS).map(i18next.t) as string[];
- const orderISO = Object.values(WEEKDAYS).map(i18next.t) as string[];
+ const monthNames = Object.values(MONTHS).map((m) => i18next.t(m)) as string[];
+ const orderISO = Object.values(WEEKDAYS).map((w) => i18next.t(w)) as string[];
const dayNames = [orderISO.pop()!, ...orderISO]; // Must start with Sunday
const rule = this._rrule!.toText((id) => i18next.t(`rrule.${id}`), { dayNames, monthNames, tokens: {} });
return html`<span class="time-label"><span>${rule}</span>${fromToTemplate}</span>`;
diff --git a/ui/component/or-translate/README.md b/ui/component/or-translate/README.md
index 48f759632..2cb9bd923 100644
--- a/ui/component/or-translate/README.md
+++ b/ui/component/or-translate/README.md
@@ -41,7 +41,7 @@ If using the default namespace then the namespace prefix can be omitted:
<or-translate value="asset" />
```
-It is also possible to pass an `TOptions<InitOptions>` object to the `18next.t` method by setting the
+It is also possible to pass a `TOptions` object to the `i18next.t` method by setting the
`options` attribute.
### Translate mixin (`dist/translate-mixin`)
diff --git a/ui/component/or-translate/package.json b/ui/component/or-translate/package.json
index 91778f9c7..629db7891 100644
--- a/ui/component/or-translate/package.json
+++ b/ui/component/or-translate/package.json
@@ -30,7 +30,7 @@
"license": "AGPL-3.0-or-later",
"dependencies": {
"@openremote/or-element": "workspace:*",
- "i18next": "^21.5.3",
+ "i18next": "^26.3.6",
"lit": "^3.3.1"
},
"devDependencies": {
diff --git a/ui/component/or-translate/src/index.ts b/ui/component/or-translate/src/index.ts
index a5e58c4b3..b0b76dee3 100644
--- a/ui/component/or-translate/src/index.ts
+++ b/ui/component/or-translate/src/index.ts
@@ -17,7 +17,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { translate } from "./translate-mixin";
-import i18next, { type InitOptions, type TOptions } from "i18next";
+import i18next, { type TOptions } from "i18next";
import { html, css } from "lit";
import { OrElement } from "@openremote/or-element";
import { customElement, property } from "lit/decorators.js";
@@ -42,7 +42,7 @@ export class OrTranslate extends translate(i18next)(OrElement) {
public value?: string;
@property({ type: Object })
- public options?: TOptions<InitOptions>;
+ public options?: TOptions;
protected render() {
return html` ${this._getTranslatedValue()} `;
diff --git a/ui/component/or-vaadin-components/package.json b/ui/component/or-vaadin-components/package.json
index fc02c3af8..ecda61c97 100644
--- a/ui/component/or-vaadin-components/package.json
+++ b/ui/component/or-vaadin-components/package.json
@@ -60,7 +60,7 @@
"@vaadin/text-field": "~25.3.0",
"@vaadin/time-picker": "~25.3.0",
"@vaadin/vaadin-themable-mixin": "~25.3.0",
- "i18next": "^21.5.3",
+ "i18next": "^26.3.6",
"lit": "^3.3.1"
},
"publishConfig": {
diff --git a/ui/test/package.json b/ui/test/package.json
index 84b99e337..43d52752d 100644
--- a/ui/test/package.json
+++ b/ui/test/package.json
@@ -36,7 +36,7 @@
"@sand4rt/experimental-ct-web": "1.59.1",
"css-loader": "^7.1.2",
"html-webpack-plugin": "^5.6.6",
- "i18next": "^21.5.3",
+ "i18next": "^26.3.6",
"i18next-http-backend": "^4.0.0",
"playwright": "1.59.1",
"playwright-core": "1.59.1",
diff --git a/ui/util/package.json b/ui/util/package.json
index 602a0756c..93782f360 100644
--- a/ui/util/package.json
+++ b/ui/util/package.json
@@ -37,7 +37,7 @@
"shx": "~0.4.0",
"source-map-loader": "^5.0.0",
"ts-loader": "~9.5.2",
- "typescript": "5.8.3",
+ "typescript": "~5.9.3",
"webpack": "^5.108.3"
},
"publishConfig": {
diff --git a/yarn.lock b/yarn.lock
index a4840d1de..6b7e39f19 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -37,13 +37,6 @@ __metadata:
languageName: node
linkType: hard
-"@babel/runtime@npm:^7.17.2":
- version: 7.29.7
- resolution: "@babel/runtime@npm:7.29.7"
- checksum: 10c0/ca11572f7146b21e0bde6a9ed4bb6a89eafbee5f0944c7eb54d0d8a2dac962c33638a1d611e14faa71dfbb92b4b5f9236232208568a6b7d5c6f3f39ddb91771e
- languageName: node
- linkType: hard
-
"@custom-elements-manifest/analyzer@npm:^0.11.0":
version: 0.11.0
resolution: "@custom-elements-manifest/analyzer@npm:0.11.0"
@@ -1814,7 +1807,7 @@ __metadata:
"@types/lodash.transform": "npm:^4"
"@types/qs": "npm:^6.9.7"
axios: "npm:1.20.0"
- i18next: "npm:^21.5.3"
+ i18next: "npm:^26.3.6"
i18next-http-backend: "npm:^4.0.0"
keycloak-js: "npm:^25.0.1"
lodash.transform: "npm:^4.6.0"
@@ -1973,7 +1966,7 @@ __metadata:
"@openremote/or-vaadin-components": "workspace:*"
"@openremote/util": "workspace:*"
axios: "npm:1.20.0"
- i18next: "npm:^21.5.3"
+ i18next: "npm:^26.3.6"
lit: "npm:^3.3.1"
languageName: unknown
linkType: soft
@@ -2376,7 +2369,7 @@ __metadata:
dependencies:
"@openremote/or-element": "workspace:*"
"@openremote/util": "workspace:*"
- i18next: "npm:^21.5.3"
+ i18next: "npm:^26.3.6"
lit: "npm:^3.3.1"
languageName: unknown
linkType: soft
@@ -2424,7 +2417,7 @@ __metadata:
"@vaadin/text-field": "npm:~25.3.0"
"@vaadin/time-picker": "npm:~25.3.0"
"@vaadin/vaadin-themable-mixin": "npm:~25.3.0"
- i18next: "npm:^21.5.3"
+ i18next: "npm:^26.3.6"
lit: "npm:^3.3.1"
languageName: unknown
linkType: soft
@@ -2474,7 +2467,7 @@ __metadata:
"@sand4rt/experimental-ct-web": "npm:1.59.1"
css-loader: "npm:^7.1.2"
html-webpack-plugin: "npm:^5.6.6"
- i18next: "npm:^21.5.3"
+ i18next: "npm:^26.3.6"
i18next-http-backend: "npm:^4.0.0"
playwright: "npm:1.59.1"
playwright-core: "npm:1.59.1"
@@ -2526,7 +2519,7 @@ __metadata:
shx: "npm:~0.4.0"
source-map-loader: "npm:^5.0.0"
ts-loader: "npm:~9.5.2"
- typescript: "npm:5.8.3"
+ typescript: "npm:~5.9.3"
webpack: "npm:^5.108.3"
bin:
orutil: ./cli.js
@@ -4024,21 +4017,12 @@ __metadata:
languageName: node
linkType: hard
-"@types/node@npm:*":
- version: 20.11.16
- resolution: "@types/node@npm:20.11.16"
- dependencies:
- undici-types: "npm:~5.26.4"
- checksum: 10c0/4886b90278e9c877a84efd3edd4667cd990e032d77268d2a798b99ebc1901ea336fa7dfbe9eaf4ad6ad1da9ce2ec31baf300038a3905838692362eb19904ebde
- languageName: node
- linkType: hard
-
-"@types/node@npm:>=10.0.0":
- version: 24.10.1
- resolution: "@types/node@npm:24.10.1"
+"@types/node@npm:*, @types/node@npm:>=10.0.0":
+ version: 26.2.0
+ resolution: "@types/node@npm:26.2.0"
dependencies:
- undici-types: "npm:~7.16.0"
- checksum: 10c0/d6bca7a78f550fbb376f236f92b405d676003a8a09a1b411f55920ef34286ee3ee51f566203920e835478784df52662b5b2af89159d9d319352e9ea21801c002
+ undici-types: "npm:~8.3.0"
+ checksum: 10c0/f8566d88162241eb55a46f7e4ea097188eab0aaafefea7a58e63adab8c4144eb98c08b7911452c846104c339a0f82282f5e1ed4b26b578d60709614fe2843f4d
languageName: node
linkType: hard
@@ -7759,12 +7743,15 @@ __metadata:
languageName: node
linkType: hard
-"i18next@npm:^21.5.3":
- version: 21.10.0
- resolution: "i18next@npm:21.10.0"
- dependencies:
- "@babel/runtime": "npm:^7.17.2"
- checksum: 10c0/2a674739aab219704d5a0bf62d03bed20ad2bceff9579efb4da61c4946c883fc172062ba7405a26bf795995860f2ab15826b05271f4c457bf7eb19e852f6006d
+"i18next@npm:^26.3.6":
+ version: 26.3.6
+ resolution: "i18next@npm:26.3.6"
+ peerDependencies:
+ typescript: ^5 || ^6 || ^7
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ checksum: 10c0/5920ac8fb6b647a2bdd439d121de04e5297246e52c4d95d13f5faae0824fd45b2faeb66038bcd61fc62362daa815f9c32fb992d6faa3787607d1dfe768e9a8b1
languageName: node
linkType: hard
@@ -9144,7 +9131,7 @@ __metadata:
eslint-plugin-promise: "npm:6.6.0"
eslint-plugin-wc: "npm:3.1.0"
prettier: "npm:3.9.6"
- typescript: "npm:5.8.3"
+ typescript: "npm:~5.9.3"
languageName: unknown
linkType: soft
@@ -11021,16 +11008,6 @@ __metadata:
languageName: node
linkType: hard
-"typescript@npm:5.8.3":
- version: 5.8.3
- resolution: "typescript@npm:5.8.3"
- bin:
- tsc: bin/tsc
- tsserver: bin/tsserver
- checksum: 10c0/5f8bb01196e542e64d44db3d16ee0e4063ce4f3e3966df6005f2588e86d91c03e1fb131c2581baf0fb65ee79669eea6e161cd448178986587e9f6844446dbb48
- languageName: node
- linkType: hard
-
"typescript@npm:~5.4.2":
version: 5.4.5
resolution: "typescript@npm:5.4.5"
@@ -11051,16 +11028,6 @@ __metadata:
languageName: node
linkType: hard
-"typescript@patch:typescript@npm%3A5.8.3#optional!builtin<compat/typescript>":
- version: 5.8.3
- resolution: "typescript@patch:typescript@npm%3A5.8.3#optional!builtin<compat/typescript>::version=5.8.3&hash=5786d5"
- bin:
- tsc: bin/tsc
- tsserver: bin/tsserver
- checksum: 10c0/39117e346ff8ebd87ae1510b3a77d5d92dae5a89bde588c747d25da5c146603a99c8ee588c7ef80faaf123d89ed46f6dbd918d534d641083177d5fac38b8a1cb
- languageName: node
- linkType: hard
-
"typescript@patch:typescript@npm%3A~5.4.2#optional!builtin<compat/typescript>":
version: 5.4.5
resolution: "typescript@patch:typescript@npm%3A5.4.5#optional!builtin<compat/typescript>::version=5.4.5&hash=5adc0c"
@@ -11100,17 +11067,10 @@ __metadata:
languageName: node
linkType: hard
-"undici-types@npm:~5.26.4":
- version: 5.26.5
- resolution: "undici-types@npm:5.26.5"
- checksum: 10c0/bb673d7876c2d411b6eb6c560e0c571eef4a01c1c19925175d16e3a30c4c428181fb8d7ae802a261f283e4166a0ac435e2f505743aa9e45d893f9a3df017b501
- languageName: node
- linkType: hard
-
-"undici-types@npm:~7.16.0":
- version: 7.16.0
- resolution: "undici-types@npm:7.16.0"
- checksum: 10c0/3033e2f2b5c9f1504bdc5934646cb54e37ecaca0f9249c983f7b1fc2e87c6d18399ebb05dc7fd5419e02b2e915f734d872a65da2e3eeed1813951c427d33cc9a
+"undici-types@npm:~8.3.0":
+ version: 8.3.0
+ resolution: "undici-types@npm:8.3.0"
+ checksum: 10c0/c8aa7e2fbebfce519654dafadc0ece59be888d2ccaf180fb4495da875e7b536d2456345c384069c7e6f3e9c9ab7435f074957da306f142343eee86ff8048855a
languageName: node
linkType: hard