Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot find type declarations for @sap/cds-dk package for CDS Plugins development #305

Open
1 task done
federicobelotti opened this issue Oct 30, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@federicobelotti
Copy link

federicobelotti commented Oct 30, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When importing from @sap/cds-dk package in a .ts file of a node.js application set up to use TypeScript (TypeScript set up via cds add typescript utility) I get this error:
Could not find a declaration file for module '@sap/cds-dk'. '@sap/cds-dk/lib/index.js' implicitly has an 'any' type.
Try npm i --save-dev @types/sap__cds-dk if it exists or add a new declaration (.d.ts) file containing declare module '@sap/cds-dk';ts(7016)

No @types/sap__cds-dk exists and there's also nothing regarding the SDK in the @cap-js/cds-types.

Expected Behavior

I'd expect to be able to replicate what is explained in the documentation about how to create a CDS plugin but with TypeScript, and I coudn't be able to find any online reference about a CDS plugin created using TypeScript.

References

CAPire documentation
Devtoberfest session where I asked about this problem, but they brought me to the TypeScript documentation on CAPire, which didn't help me.

Versions

@cap-js/asyncapi: 1.0.2
@cap-js/cds-typer: 0.28.0
@cap-js/cds-types: 0.6.5
@cap-js/db-service: 1.14.1
@cap-js/openapi: 1.0.6
@cap-js/sqlite: 1.7.5
@sap/cds: 8.4.0
@sap/cds-compiler: 5.4.0
@sap/cds-dk: 8.3.0
@sap/cds-dk (global): 8.3.0
@sap/cds-fiori: 1.2.7
@sap/cds-foss: 5.0.1
@sap/cds-mtxs: 2.2.0
@sap/eslint-plugin-cds: 3.1.0
Node.js: v20.15.0
cap-dummy-plugin: 1.0.0

Anything else? Logs?

No response

@federicobelotti federicobelotti added the bug Something isn't working label Oct 30, 2024
@daogrady
Copy link
Contributor

Hi Federico,

that is correct, cds-dk has no types as of today. We are currently discussing internally how to properly provide these types, hopefully without having to introduce another type package.

Best,
Daniel

@federicobelotti
Copy link
Author

Hello Daniel,
thank you very much for the update.

Regards,
Federico

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants