Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/pluggable-widgets-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Changed

- We now enforce the same validation for the `widgetName` in the widget bundler as we do in the generator.

## [11.3.0] - 2025-11-12

### Changed
Expand Down
7 changes: 7 additions & 0 deletions packages/pluggable-widgets-tools/configs/shared.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ export const widgetVersion = widgetPackageJson.version;
if (!widgetName || !widgetPackageJson) {
throw new Error("Widget does not define widgetName in its package.json");
}
if (!/^[a-zA-Z]+$/.test(widgetName)) {
const illegalChars = (widgetName.match(/[^a-zA-Z]/g) ?? [])
.reduce((unique, c) => unique.includes(c) ? unique : [...unique, c], [])
.map(c => `"${c}"`)
.join(", ");
throw new Error(`Widget contains unexpected character ${illegalChars} in its widgetName in package.json. Only lowercase and uppercase letters ([a-zA-Z]) are allowed.`);
}

const widgetSrcFiles = readdirSync(join(sourcePath, "src")).map(file => join(sourcePath, "src", file));
export const widgetEntry = widgetSrcFiles.filter(file =>
Expand Down
2 changes: 1 addition & 1 deletion packages/pluggable-widgets-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mendix/pluggable-widgets-tools",
"version": "11.3.0",
"version": "11.3.1",
"description": "Mendix Pluggable Widgets Tools",
"engines": {
"node": ">=20"
Expand Down
Loading