chore: Cleanup package exports and surface - #74
Conversation
|
👋 Hi — I'm PR Bot, your SAP code review assistant. I'll automatically review your pull requests for code quality, security, and SAP compliance. Get an overview of what I do → What I do
Key commands
*This introduction message will be shown to you only once, you will not see it in future PRs. |
SummaryThe following content is AI-generated and provides a summary of the pull request: Cleanup Package Exports and Public SurfaceThis PR removes the public package exports and entry points from Changes include:
Have you...
PR Bot InformationVersion:
|
schiwekM
left a comment
There was a problem hiding this comment.
index.js is needed for eval to import JS helpers, but yes the remaining exports can be removed and are legacy artifacts when we did not have the build* hooks
can't we make cds-plugin.js the main? |
|
Of cause, as long as we have one entrance JS file where JS helpers for eval can be exported it is fine |
Akatuoro
left a comment
There was a problem hiding this comment.
Removing ./lib/models/* leads to the error
Cannot find module '/home/runner/work/agents/agents/node_modules/@cap-js/agents/lib/models/aicore' imported from /home/runner/work/agents/agents/srv/handlers/index.js
due to the dynamic imports.
The minimal working exports is
"exports": {
"./cds-plugin": "./cds-plugin.js", // loading the plugin
"./lib/index.cjs": "./lib/index.cjs", // protocol adapter
"./lib/models/*": "./lib/models/*.js" // model implementations
},
Nobody should do any imports of
@cap-js/agents, even less of any nested modules, should they?