gnodet opened a new pull request, #22157:
URL: https://github.com/apache/camel/pull/22157

   ## Summary
   
   Add a `camel transform dataweave` CLI command that converts MuleSoft 
DataWeave 2.0 scripts into equivalent DataSonnet `.ds` files, reducing the 
effort of migrating Mule integrations to Apache Camel.
   
   - **Hand-written recursive descent parser** for DataWeave 2.0 syntax 
(header, field access, operators, lambdas, collection ops, type coercion, etc.)
   - **AST-based conversion** to DataSonnet using Camel's CML functions 
(`cml.defaultVal`, `cml.toInteger`, `cml.nowFmt`, etc.) and `camel.libsonnet` 
helpers
   - **Handles ~80% of common patterns** mechanically; flags unsupported 
constructs with `// TODO` comments
   - **43 unit tests** covering field access, operators, type coercion, null 
handling, collections (map/filter/reduce with acc/item swap), string ops, full 
script conversion
   
   ### CLI usage
   
   ```bash
   camel transform dataweave --input flow.dwl --output flow.ds
   camel transform dataweave --input src/main/mule/ --output src/main/resources/
   camel transform dataweave -e 'payload.name default "unknown"'
   ```
   
   ### Depends on
   
   - #22156 (camel-datasonnet CML enhancements and `camel.libsonnet` standard 
library)
   
   ## Test plan
   
   - [x] 43 unit tests in `DataWeaveConverterTest` covering all conversion 
patterns
   - [x] Full `camel-jbang-core` test suite passes (289 tests)
   - [ ] Manual testing with real-world DataWeave scripts from Mule projects


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to