diff --git a/packages/pluggable-widgets-tools/CHANGELOG.md b/packages/pluggable-widgets-tools/CHANGELOG.md index dff2caac..b540a557 100644 --- a/packages/pluggable-widgets-tools/CHANGELOG.md +++ b/packages/pluggable-widgets-tools/CHANGELOG.md @@ -10,6 +10,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - We updated the transpilation targets for babel to target more recent browsers. +- We changed [System Text XML](https://docs.mendix.com/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#text) type to use `namespace` instead of `widgetId`, since we now allow Pluggable Widgets to refer to all system texts. + +- We updated the Mendix package to 11.15. + + ### Fixed - We fixed an issue with object destructuring assignments caused by a polyfill. (Issue #176) diff --git a/packages/pluggable-widgets-tools/package.json b/packages/pluggable-widgets-tools/package.json index 0ae153ed..4bac7b5d 100644 --- a/packages/pluggable-widgets-tools/package.json +++ b/packages/pluggable-widgets-tools/package.json @@ -1,6 +1,6 @@ { "name": "@mendix/pluggable-widgets-tools", - "version": "11.13.0", + "version": "11.15.0", "description": "Mendix Pluggable Widgets Tools", "engines": { "node": "^22.18.0" @@ -46,6 +46,8 @@ "@rollup/plugin-typescript": "^12.1.1", "@rollup/plugin-url": "^8.0.2", "@rollup/pluginutils": "^5.3.0", + "@swc/core": "^1.10.0", + "@swc/jest": "^0.2.37", "@testing-library/dom": "^10.4.1", "@testing-library/jest-dom": "^6.9.1", "@testing-library/react": "^16.3.2", @@ -79,7 +81,7 @@ "jest-jasmine2": "~30.5.0", "jest-junit": "^17.0.0", "make-dir": "^5.1.0", - "mendix": "^11.8.0", + "mendix": "^11.15.0", "mime": "^4.1.0", "postcss": "^8.5.18", "postcss-import": "^14.0.2", @@ -99,8 +101,6 @@ "semver": "^7.3.2", "shelljs": "^0.10.0", "shx": "^0.4.0", - "@swc/core": "^1.10.0", - "@swc/jest": "^0.2.37", "ts-jest": "^29.4.9", "ts-node": "^10.9.2", "typescript": "^5.6.3", diff --git a/packages/pluggable-widgets-tools/src/typings-generator/WidgetXml.ts b/packages/pluggable-widgets-tools/src/typings-generator/WidgetXml.ts index 5b4ebb6b..d687137a 100644 --- a/packages/pluggable-widgets-tools/src/typings-generator/WidgetXml.ts +++ b/packages/pluggable-widgets-tools/src/typings-generator/WidgetXml.ts @@ -145,7 +145,7 @@ export interface SystemTextParameter { export interface ExternalSystemTextNamespace { $: { - widgetId: string; + namespace: string; }; text: ExternalSystemText[]; } diff --git a/packages/pluggable-widgets-tools/src/typings-generator/__tests__/inputs/systemtexts.ts b/packages/pluggable-widgets-tools/src/typings-generator/__tests__/inputs/systemtexts.ts index 42fb6b79..50aa0526 100644 --- a/packages/pluggable-widgets-tools/src/typings-generator/__tests__/inputs/systemtexts.ts +++ b/packages/pluggable-widgets-tools/src/typings-generator/__tests__/inputs/systemtexts.ts @@ -16,11 +16,11 @@ const systemProperty = ` - + - + `; export const systemTextsInput = ` diff --git a/packages/pluggable-widgets-tools/src/typings-generator/generateSystemTexts.ts b/packages/pluggable-widgets-tools/src/typings-generator/generateSystemTexts.ts index c38041cc..d58e1e2a 100644 --- a/packages/pluggable-widgets-tools/src/typings-generator/generateSystemTexts.ts +++ b/packages/pluggable-widgets-tools/src/typings-generator/generateSystemTexts.ts @@ -4,7 +4,7 @@ import { SystemProperty, TextSystemProperty } from "./WidgetXml"; const STAR = "*" as const; type Star = typeof STAR; -type Text = { key: string; parameters: string[] } | { widgetId: string; key: Star | string[] }; +type Text = { key: string; parameters: string[] } | { namespace: string; key: Star | string[] }; function textsFromSystemProperty(node: SystemProperty): Text[] { if (!isTextSystemProperty(node)) return []; @@ -16,7 +16,7 @@ function textsFromSystemProperty(node: SystemProperty): Text[] { })), ...(node.externalTexts ?? []).map(e => { return { - widgetId: e.$.widgetId, + namespace: e.$.namespace, key: e.text === undefined ? STAR : e.text.map(t => t.$.key) }; }) @@ -28,11 +28,11 @@ function isTextSystemProperty(node: SystemProperty): node is TextSystemProperty } function generateTextType(t: Text): string { - if ("widgetId" in t) { + if ("namespace" in t) { if (t.key === STAR) { - return `"${t.widgetId}": [key: string, params?: string[]]`; + return `"${t.namespace}": [key: string, params?: string[]]`; } - return `"${t.widgetId}": [key: ${t.key.map(key => `"${key}"`).join(" | ")}, params?: string[]]`; + return `"${t.namespace}": [key: ${t.key.map(key => `"${key}"`).join(" | ")}, params?: string[]]`; } const parameterTypes = t.parameters.map(p => `${normalizeParameterName(p)}: string`); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6cd5ebdf..2322da71 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -301,8 +301,8 @@ importers: specifier: ^5.1.0 version: 5.1.0 mendix: - specifier: ^11.8.0 - version: 11.10.0 + specifier: ^11.15.0 + version: 11.15.0 mime: specifier: ^4.1.0 version: 4.1.0 @@ -5249,8 +5249,8 @@ packages: memoize-one@5.2.1: resolution: {integrity: sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==} - mendix@11.10.0: - resolution: {integrity: sha512-OsLdgNJfhwG4/TcOIMMk0gu0ewHq3Xlv2CNW1YJy2ujqD19ngFvBVB9YTjYxmf+RMn1EG0FQYrn6zCSFzmbL4A==} + mendix@11.15.0: + resolution: {integrity: sha512-LX0sreXwbRF/9cGbDwaRHBGkcjdweQsoyWPmVnCS96VpeSLm2tcg0bJUDCEAkkxyJ+GG+DMTRUxRilYtG6Fyeg==} merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -13351,7 +13351,7 @@ snapshots: memoize-one@5.2.1: {} - mendix@11.10.0: + mendix@11.15.0: dependencies: '@types/big.js': 6.2.2 '@types/react': 19.2.14