Skip to content

Commit 98fc29a

Browse files
authored
feat(web_core): add resolveAction and improve error handling (a2ui-project#856)
* feat(web_core): bump version to 0.8.6 with expression and formatDate updates - Update logical functions (`and`, `or`) to require the `values` array argument, removing deprecated individual arguments. - Update `formatDate` to require `format` parameter, utilizing `date-fns`. - Update expressions and math schemas with a preprocess layer for cleaner `null` layout to `undefined` coercion. - Update guards and data-context tests for expanded v0.9 safety checks. * Update package locks * feat(web_core): Implement error reporting in DataContext - Added SurfaceModel.dispatchError to format and emit error events conforming to v0.9 generic error schema. - Updated DataContext.resolveDynamicValue and evaluateFunctionReactive to capture A2uiExpressionError & ZodError, dispatching to surface and returning fallbacks to avoid crashes. - Updated ComponentContext and test suites (data-context, basic_functions, function_execution) to align with return-instead-of-throw design. - All tests passing green. * Update renderers/web_core/src/v0_9/basic_catalog/functions/basic_functions.test.ts Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * refactor(web_core): replace email validation with more robust regex Updated the `EmailImplementation` to use a restricting regex requiring a 2-char TLD and standard valid characters. Increased the test coverage in `basic_functions.test.ts` for multiple email formats and fixed an unrelated issue in the `divide` test that was causing test failures due to strict type checking. * docs(web_core): clarify action context resolution is non-recursive by design Updated the comment in `resolveAction` to explain that its one-level non-recursive behavior aligns with the schema spec, which requires values to be single `DynamicValue` types and restricts arbitrary nesting. * Cleaning up test, converting an Error to A2uiExpressionError * Bump patch version
1 parent 93b98bb commit 98fc29a

32 files changed

Lines changed: 1485 additions & 533 deletions

renderers/angular/package-lock.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

renderers/lit/package-lock.json

Lines changed: 5 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

renderers/markdown/markdown-it/package-lock.json

Lines changed: 5 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

renderers/web_core/CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
## 0.8.6
2+
3+
- Update logical functions (`and`, `or`) to require a `values` array argument, removing deprecated individual arguments.
4+
- Update `formatDate` to require `format` parameter to align with new configuration, utilizing `date-fns`.
5+
- Add `date-fns` dependency for expression string formatting workflows.
6+
- Update math and comparison expression schemas with preprocessing step to correctly coerce `null` parameters into `undefined` for tighter validation constraints.
7+
- Fix associated tests in expressions and rendering models corresponding to validation updates.
8+
- Improve error messages to include the function name and the catalog ID.
9+
110
## 0.8.5
211

3-
- Add `V8ErrorConstructor` interface to be able to access V8-only
12+
- Add `V8ErrorConstructor` interface to be able to access V8-only
413
`captureStackTrace` method in errors.
514
- Removes dependency from `v0_8` to `v0_9` by duplicating the `errors.ts` file.
615

renderers/web_core/package-lock.json

Lines changed: 12 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

renderers/web_core/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@a2ui/web_core",
3-
"version": "0.8.5",
3+
"version": "0.8.6",
44
"description": "A2UI Core Library",
55
"main": "./dist/src/v0_8/index.js",
66
"types": "./dist/src/v0_8/index.d.ts",
@@ -93,6 +93,7 @@
9393
},
9494
"dependencies": {
9595
"@preact/signals-core": "^1.13.0",
96+
"date-fns": "^4.1.0",
9697
"zod": "^3.25.76"
9798
}
9899
}

0 commit comments

Comments
 (0)