Skip to content

Commit 91e89f5

Browse files
authored
Merge branch 'main' into fix/DG-col-selector-accessibility
2 parents 049269a + 1f0d03a commit 91e89f5

148 files changed

Lines changed: 3081 additions & 2802 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/hooks/post-edit.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash
2+
# Auto-format and lint after file edits.
3+
# Works with both Claude Code (PostToolUse) and GitHub Copilot (postToolUse) hooks.
4+
#
5+
# Input formats:
6+
# Claude Code: {"tool_input": {"file_path": "/path/to/file"}}
7+
# Copilot: {"toolName": "edit", "toolArgs": "{\"path\": \"/path/to/file\"}"}
8+
#
9+
# Exit codes:
10+
# 0 = success (formatting applied silently)
11+
# 2 = lint errors found (fed back to Claude as feedback; ignored by Copilot)
12+
13+
# Parse file path - handles both Claude Code and Copilot input formats
14+
FILE_PATH=$(cat | node -e "
15+
let d='';
16+
process.stdin.on('data',c=>d+=c);
17+
process.stdin.on('end',()=>{
18+
try {
19+
const j=JSON.parse(d);
20+
if (j.tool_input?.file_path) { console.log(j.tool_input.file_path); return; }
21+
if (j.toolArgs) { const a=JSON.parse(j.toolArgs); if (a.path) console.log(a.path); }
22+
} catch {}
23+
})
24+
")
25+
26+
# Skip if no file path or file doesn't exist
27+
[[ -z "$FILE_PATH" || ! -f "$FILE_PATH" ]] && exit 0
28+
29+
# Find the nearest package directory with eslint config
30+
SEARCH_DIR=$(dirname "$FILE_PATH")
31+
PACKAGE_DIR=""
32+
while [[ "$SEARCH_DIR" != "/" ]]; do
33+
if [[ -f "$SEARCH_DIR/eslint.config.mjs" ]]; then
34+
PACKAGE_DIR="$SEARCH_DIR"
35+
break
36+
fi
37+
SEARCH_DIR=$(dirname "$SEARCH_DIR")
38+
done
39+
40+
# Auto-format with prettier from the package directory
41+
if [[ -n "$PACKAGE_DIR" ]]; then
42+
(cd "$PACKAGE_DIR" && pnpm exec prettier --write "$FILE_PATH" 2>/dev/null)
43+
else
44+
pnpm exec prettier --write "$FILE_PATH" 2>/dev/null
45+
fi
46+
47+
# Run lint from the package directory using the project's lint setup
48+
if [[ -n "$PACKAGE_DIR" ]]; then
49+
LINT_OUTPUT=$(cd "$PACKAGE_DIR" && pnpm run lint 2>&1)
50+
if [[ $? -ne 0 ]]; then
51+
echo "$LINT_OUTPUT" >&2
52+
exit 2
53+
fi
54+
fi
55+
56+
exit 0

.claude/settings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"hooks": {
3+
"PostToolUse": [
4+
{
5+
"matcher": "Edit|Write|MultiEdit",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": ".claude/hooks/post-edit.sh"
10+
}
11+
]
12+
}
13+
]
14+
}
15+
}

.github/hooks/hooks.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": 1,
3+
"hooks": {
4+
"postToolUse": [
5+
{
6+
"type": "command",
7+
"bash": "bash .claude/hooks/post-edit.sh"
8+
}
9+
]
10+
}
11+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ tests
2828
automation/run-e2e/ctrf/*.json
2929
.cursor
3030
.windsurf
31+
.claude/settings.local.json

AGENTS.md

Lines changed: 26 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,35 @@
1-
# Mendix Web Widgets Repository - AI Agent Overview
1+
# Mendix Web Widgets Repository
22

3-
This document provides a comprehensive overview of the Mendix Web Widgets repository structure and conventions for AI development assistants. This repository contains the official collection of pluggable web widgets for the Mendix low-code platform.
3+
Monorepo of official Mendix pluggable web widgets. pnpm workspaces + Turbo.
44

5-
## Repository Overview
5+
## Structure
66

7-
The **Mendix Web Widgets** repository is the official home of all Mendix platform-supported pluggable web widgets and related modules. These are reusable UI components built with modern web technologies (React, TypeScript, SCSS) that integrate seamlessly into Mendix Studio Pro applications.
7+
- `packages/pluggableWidgets/*-web` — Widget packages (React, TypeScript, SCSS)
8+
- `packages/modules/*` — Mendix module packages
9+
- `packages/shared/*` — Shared configs and utilities
10+
- `automation/` — Build and release automation
11+
- `docs/requirements/` — Detailed technical requirements
812

9-
### Key Characteristics
10-
- **Monorepo structure** using pnpm workspaces and Turbo for build orchestration
11-
- **Modern web stack**: TypeScript, React, SCSS, Jest, ESLint, Prettier
12-
- **Mendix integration**: Built using Mendix Pluggable Widgets API
13-
- **Atlas UI alignment**: Consistent with Mendix's design system
14-
- **Comprehensive testing**: Unit tests (Jest/RTL), E2E tests (Playwright)
13+
## Commands
1514

16-
## Repository Structure
15+
| Command | Description |
16+
|---------|-------------|
17+
| `pnpm install` | Install dependencies |
18+
| `pnpm build` | Build all packages |
19+
| `pnpm lint` | Lint all packages |
20+
| `pnpm test` | Test all packages |
21+
| `pnpm --filter @mendix/<name> run <script>` | Run script in one package |
1722

18-
```
19-
├── packages/
20-
│ ├── pluggableWidgets/ # Main widget packages (*-web folders)
21-
│ ├── modules/ # Mendix modules
22-
│ ├── customWidgets/ # Custom widget implementations
23-
│ └── shared/ # Shared configurations and utilities
24-
├── docs/
25-
│ └── requirements/ # Detailed technical requirements (see below)
26-
├── automation/ # Build and release automation
27-
└── .github/ # GitHub workflows and Copilot instructions
28-
```
23+
## Conventions
2924

30-
## Detailed Requirements Documentation
25+
- TypeScript + React functional components + SCSS
26+
- Mendix Pluggable Widgets API (EditableValue, ActionValue, ListValue)
27+
- Atlas UI design system for styling
28+
- Conventional commits (commitlint enforced)
29+
- Semver versioning + CHANGELOG.md per package
3130

32-
The `/docs/requirements/` folder contains comprehensive technical documentation for understanding and contributing to this repository. Each document covers specific aspects of the development process:
31+
## Agent-Specific Instructions
3332

34-
### Core Requirements and Guidelines
35-
36-
- **[Project Requirements Document](docs/requirements/project-requirements-document.md)** - High-level overview of repository purpose, goals, target users, and design system alignment
37-
- **[Technology Stack and Project Structure](docs/requirements/tech-stack.md)** - Core technologies, monorepo structure, configuration standards, and development tools
38-
- **[Frontend Guidelines](docs/requirements/frontend-guidelines.md)** - CSS/SCSS styling guidelines, naming conventions, component best practices, and Atlas UI integration
39-
40-
### Development Workflow and Integration
41-
42-
- **[Application Flow and Widget Lifecycle](docs/requirements/app-flow.md)** - Complete widget development lifecycle from scaffolding to Studio Pro integration
43-
- **[Backend Structure and Data Flow](docs/requirements/backend-structure.md)** - Widget-to-Mendix runtime integration, data handling, and event management
44-
- **[Implementation Plan](docs/requirements/implementation-plan.md)** - Step-by-step guide for creating new widgets, including PR templates and testing requirements
45-
46-
### Module Development
47-
48-
- **[Widget to Module Conversion](docs/requirements/widget-to-module.md)** - Guidelines for converting widgets to Mendix modules when appropriate
49-
50-
## Development Commands
51-
52-
Key commands for working with this repository:
53-
54-
- **`pnpm lint`** - Run linting across all packages
55-
- **`pnpm test`** - Run unit tests across all packages
56-
- **`pnpm build`** - Build all packages
57-
- **`pnpm -w changelog`** - Update changelogs
58-
- **`pnpm -w version`** - Bump versions across packages
59-
60-
## AI Development Assistant Context
61-
62-
### For Code Reviews and PR Analysis
63-
See [.github/copilot-instructions.md](.github/copilot-instructions.md) for detailed PR review guidelines, including:
64-
- Mendix-specific conventions and API usage
65-
- React best practices and performance considerations
66-
- Testing requirements (unit, component, E2E)
67-
- Styling guidelines and Atlas UI integration
68-
- Version management and changelog requirements
69-
70-
### For Code Development
71-
When working on this repository, prioritize:
72-
73-
1. **Minimal changes** - Make surgical, precise modifications
74-
2. **Mendix conventions** - Follow established patterns for XML configuration, TypeScript props, and data handling
75-
3. **Testing coverage** - Ensure unit tests, component tests, and E2E tests as appropriate
76-
4. **Atlas UI consistency** - Use Atlas classes and design tokens
77-
5. **Performance** - Consider React render optimization and Mendix data efficiency
78-
79-
### Common Development Patterns
80-
81-
- **Widget Structure**: Each widget has XML configuration, TypeScript component, SCSS styling, and test files
82-
- **Data Integration**: Use Mendix API objects (EditableValue, ActionValue, ListValue) correctly
83-
- **Styling**: Prefer Atlas UI classes over custom styles; use SCSS for widget-specific styling
84-
- **Testing**: Follow Jest + RTL for unit tests, Playwright for E2E testing
85-
86-
## Getting Started
87-
88-
1. **Prerequisites**: Node.js ≥22, pnpm 10.15.0
89-
2. **Installation**: `pnpm install`
90-
3. **Development**: Set `MX_PROJECT_PATH` environment variable to your Mendix project
91-
4. **Building**: Use `pnpm build` or `pnpm start` for development builds
92-
5. **Testing**: Use `pnpm test` for unit tests, `pnpm e2e` for E2E tests
93-
94-
For detailed implementation guidance, refer to the specific requirement documents linked above.
33+
- **Claude Code** — See `CLAUDE.md` for hooks, commands, and detailed instructions
34+
- **GitHub Copilot** — See `.github/copilot-instructions.md` for PR review guidelines
35+
- **Cursor / Windsurf** — See `docs/requirements/` for rule files (YAML frontmatter compatible)

CLAUDE.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Mendix Web Widgets
2+
3+
Monorepo of official Mendix pluggable web widgets. pnpm workspaces + Turbo.
4+
5+
## Commands
6+
7+
- Install: `pnpm install`
8+
- Build all: `pnpm build`
9+
- Build one: `pnpm --filter @mendix/<name> run build`
10+
- Test one: cd into package dir, run `pnpm run test` (NOT from repo root)
11+
- Lint one: cd into package dir, run `pnpm run lint`
12+
- Changelog: `pnpm -w changelog`
13+
14+
## Structure
15+
16+
```
17+
packages/pluggableWidgets/*-web/ -> Widget packages (React + TS + SCSS)
18+
packages/modules/ -> Mendix module packages
19+
packages/shared/ -> Shared configs, plugins, utilities
20+
automation/ -> Build/release automation
21+
docs/requirements/ -> Detailed technical requirements
22+
```
23+
24+
## Hooks (auto-applied)
25+
26+
- **Auto-format**: Every file edit is auto-formatted by prettier via PostToolUse hook.
27+
Do NOT manually run `prettier --write` — it wastes tokens, the hook handles it.
28+
- **Auto-lint**: After each edit, eslint runs via `pnpm run lint` in the file's package.
29+
Lint errors are fed back automatically — fix them in the next edit, do NOT run lint commands manually.
30+
31+
## Conventions
32+
33+
- TypeScript strict, React functional components + hooks
34+
- Mendix Pluggable Widgets API: EditableValue, ActionValue, ListValue, DynamicValue
35+
- Check ActionValue.canExecute before execute()
36+
- Render loading/empty states until values are ready
37+
- SCSS for styling, prefer Atlas UI classes, BEM-like naming with widget prefix
38+
- Conventional commits enforced: `type(scope): description`
39+
- Semver + CHANGELOG.md per package for runtime/XML/behavior changes
40+
- Jest + RTL for unit tests (src/**tests**/\*.spec.ts)
41+
- Playwright for E2E (e2e/\*.spec.js)
42+
43+
## Development Setup
44+
45+
- Node >=22, pnpm 10.x
46+
- Set MX_PROJECT_PATH to Mendix project dir for live reload
47+
- Run `pnpm start` inside widget package for dev build
48+
49+
## Detailed Reference
50+
51+
For deeper context, see:
52+
53+
- @docs/requirements/tech-stack.md — Full technology stack
54+
- @docs/requirements/frontend-guidelines.md — CSS/SCSS/Atlas UI guidelines
55+
- @docs/requirements/app-flow.md — Widget lifecycle and Studio Pro integration
56+
- @docs/requirements/backend-structure.md — Data flow and Mendix runtime
57+
- @docs/requirements/implementation-plan.md — New widget guide + PR template
58+
- @docs/requirements/project-requirements-document.md — Goals and scope
59+
60+
## Constraints
61+
62+
- Never modify dist/, generated files, or lockfiles
63+
- XML property keys: lowerCamelCase, must match TypeScript props exactly
64+
- Don't override core Atlas UI classes
65+
- Prefer tree-shakable imports for new dependencies

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Apache License
1+
Apache License
22
Version 2.0, January 2004
33
http://www.apache.org/licenses/
44

automation/utils/bin/rui-agent-rules.ts

Lines changed: 0 additions & 50 deletions
This file was deleted.

automation/utils/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"copyright": "© Mendix Technology BV 2025. All rights reserved.",
66
"private": true,
77
"bin": {
8-
"rui-agent-rules": "bin/rui-agent-rules.ts",
98
"rui-create-gh-release": "bin/rui-create-gh-release.ts",
109
"rui-create-translation": "bin/rui-create-translation.ts",
1110
"rui-generate-package-xml": "bin/rui-generate-package-xml.ts",
@@ -25,7 +24,6 @@
2524
"tsconfig.json"
2625
],
2726
"scripts": {
28-
"agent-rules": "ts-node bin/rui-agent-rules.ts",
2927
"changelog": "ts-node bin/rui-changelog-helper.ts",
3028
"check-changelogs": "ts-node bin/rui-check-changelogs.ts",
3129
"compile:parser:module": "peggy -o ./src/changelog-parser/parser/widget/widget.js ./src/changelog-parser/parser/widget/widget.pegjs",

docs/requirements/implementation-plan.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ Implement basic rendering and add error/loading states.
3535
Import SCSS for styling and use Atlas UI classes.
3636

3737
6. Build and Run in Studio Pro
38-
Set the MX_PROJECT_PATH environment variable to your test project's directory, you can ask what the project name running in Studio Pro is so that we can se the MX_PROJECT_PATH. The path is: /Users/rahman.unver/Mendix/ProjectName, this path is always same for the macOS version of Studio Pro. For Windows version, our path is /Volumes/[C] Windows11/Users/Rahman.Unver/Documents/ProjectName. example setting:
38+
Set the MX_PROJECT_PATH environment variable to your test project's directory, you can ask what the project name running in Studio Pro is so that we can set the MX_PROJECT_PATH. The path is: /Users/<your-username>/Mendix/ProjectName, this path is always same for the macOS version of Studio Pro. For Windows version, the path is /Volumes/[C] Windows11/Users/<your-username>/Documents/ProjectName. example setting:
3939
Windows:
4040

41-
- export MX_PROJECT_PATH=/Volumes/[C] Windows11/Users/Rahman.Unver/Documents/DocumentViewerWidget
42-
- export MX_PROJECT_PATH=/Users/rahman.unver/Mendix/RichTextTest
41+
- export MX_PROJECT_PATH=/Volumes/[C] Windows11/Users/<your-username>/Documents/MyTestProject
42+
- export MX_PROJECT_PATH=/Users/<your-username>/Mendix/MyTestProject
4343

4444
Run pnpm start (or npm start) to build and watch for changes.
4545

0 commit comments

Comments
 (0)