chore: working sample without cap-js#89
Conversation
There was a problem hiding this comment.
The PR removes the @cap-js/ai Node.js dependency and cds-feature-recommendations Java artifact, replacing them with a manually-maintained recommendations.cds model and a new com.sap.cds/ai import path. There are two correctness issues in the new recommendations.cds that need attention: the association on condition and the non-standard @UI.Recommendations annotation — please verify both compile and produce the expected Fiori Elements behavior before merging.
PR Bot Information
Version: 1.26.0
- LLM:
anthropic--claude-4.6-sonnet - Event Trigger:
pull_request.opened - File Content Strategy: Full file content
- Correlation ID:
ebd21fad-ab7e-44fd-93d4-6d77b437393e
|
@lisajulia do we want to provide two separate solutions, or provide the non cap-js/ai solution and tell the people that if they want automatic registration they have to use cap-js/ai and can skip the part that is in recommendations.cds |
Remove
@cap-js/aiDependency from Bookshop SampleRefactor
♻️ Refactored the bookshop sample to eliminate the
@cap-js/aiNode.js package dependency, replacing its auto-generated compile-time enhancements with manual CDS model definitions.Changes
samples/bookshop/.cdsrc.json: Removed theAICoreservice model reference pointing to@cap-js/ai/srv/AICoreServiceand thecdsc.moduleLookupDirectoriesconfiguration block.samples/bookshop/package.json: Removed@cap-js/aifrom thedependenciessection.samples/bookshop/package-lock.json: Removed the@cap-js/aipackage entry and its resolved metadata.samples/bookshop/pom.xml: Removed thecds-feature-recommendationsMaven dependency from the dependency management section.samples/bookshop/srv/pom.xml: Removed thecds-feature-recommendationsMaven dependency from the service module.samples/bookshop/srv/ai-core-service.cds: Updated theAICoreimport source from@cap-js/ai/srv/AICoreServicetocom.sap.cds/ai.samples/bookshop/srv/recommendations.cds(new): Added a manually defined CDS model that replicates the recommendations structure previously auto-generated by the@cap-js/aiplugin. This includes theBooks_Recommendationsvirtual entity with fields forgenre_IDandcurrency_code, a navigation property extension onAdminService.Books, and the@UI.Recommendationsannotation.PR Bot Information
Version:
1.26.0pull_request.openedebd21fad-ab7e-44fd-93d4-6d77b437393eanthropic--claude-4.6-sonnet