Skip to content

fix: mark @sap/cds-dk peer dependency as optional - #156

Merged
daogrady merged 1 commit into
cap-js:mainfrom
bkohenkel:fix/optional-cds-dk-peer
Oct 29, 2026
Merged

daogrady merged 1 commit into
cap-js:mainfrom
bkohenkel:fix/optional-cds-dk-peer

Conversation

@bkohenkel

Copy link
Copy Markdown
Contributor

Fixes #155

@sap/cds-dk is only needed for the cds build plugin, and cds-plugin.js already
guards that with cds.build?.register?.(...) — at runtime the plugin works
without cds-dk.

Because the peer is currently required, npm 7+ auto-installs @sap/cds-dk into
every consuming app's production dependency tree. Its bundled dependencies
(e.g. handlebars) then show up in security scans and cannot be fixed via
overrides, forcing apps to use legacy-peer-deps.

Marking the peer as optional preserves compatibility validation when
@sap/cds-dk is installed, while preventing npm from installing it
automatically for runtime-only consumers.

Verified in a clean consumer project that installing @cap-js/notifications
without @sap/cds-dk no longer installs cds-dk, while the runtime plugin still
loads; with @sap/cds-dk installed, the notifications build task is still
registered.

@bkohenkel
bkohenkel deployed to pr-approval October 15, 2026 14:13 — with GitHub Actions Active
@daogrady
daogrady self-requested a review October 23, 2026 08:19

@daogrady daogrady left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!
Without being too deep into this particular code base, I believe your proposed change makes sense.

I am no sure why the Node22 test suite fails, but since it works properly on Node24, I'd say we're good.

@bkohenkel

Copy link
Copy Markdown
Contributor Author

Hi @daogrady
Looks to me test Node 22 is breaking because cf login fails.

Thanks
Branimir

@bkohenkel
bkohenkel deployed to pr-approval October 29, 2026 12:14 — with GitHub Actions Active
@daogrady
daogrady merged commit ad2bb78 into cap-js:main Oct 29, 2026
22 of 26 checks passed
@daogrady

Copy link
Copy Markdown

Hi @bkohenkel ,

pipeline is green and merged, thanks again for the contribution!
I can not give you a strict timeline on when the next release will take place that includes this fix, as that is under the governance of the team picking this project up.

Best,
Daniel

@bkohenkel
bkohenkel deleted the fix/optional-cds-dk-peer branch October 30, 2026 12:01

This branch was successfully deployed

1 active deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mark @sap/cds-dk peer dependency as optional

2 participants