-
Notifications
You must be signed in to change notification settings - Fork 8
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] @cap-js/cds-types v0.6.0 - Post install script not working #136
Comments
This issue is causing errors in initializing a sample cap project.
changing this to the following allows to proceed with initializing sample project.
|
Hi everyone, thanks for pointing out this problem on Windows. We will see what we can do to unblock Windows users. Best, |
Hi @daogrady, I'm not sure if you are aware, but this issue can also be solved without creating a symbolic link. {
"compilerOptions": {
"target": "ESNext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"sourceMap": true,
"allowJs": true,
"paths": {
"#cds-models/*": [
"./@cds-models/*/index.ts"
]
},
"typeRoots": [
"./node_modules/@types",
"./node_modules/@cap-js"
]
}
} This is working perfectly fine without the need of a symbolic link. (similar setup like the UI5 team does for the UI5 types) Anyway, this feels like a more solid and standard TypeScript configuration. Might be worth considering for you guys :) Cheers, |
Hi Geert-Jan, thanks for pointing this out! We have considered an additional If having the Best, |
Hi everyone, we just released cds-types 0.6.1 which contains a fix for the post install script on windows which should address this issue. Best, |
Hi @daogrady, I opened the issue on Linux, not on Windows. Cheers, |
Hi Geert-Jan, sorry for the inconvenience! Is this the same error you encountered originally? It looks like this error pops up in the context of building/ bundling? Best, |
Hi @daogrady, Seems like a slightly different situation indeed.
Based on the configuration the last situation shouldn't happen (as @cap-js/cds-types has peer dependency to @sap/cds @ 8) I'm able to fix this by explicitly installing @cap-js/cds-types @0.2.0 in the project. I also retested the initial issue (on cds v8) and this issue does seem to be resolved. So maybe lets close this issue, I'll do some further analysis on the existing project and if needed I'll open a new issue. Cheers, |
Hi Geert-Jan, thanks for the analysis of the problem! That is indeed an issue, as cds-types 0.6 should only be used in combination with cds 8. Pipelines pulling in cds-types 0.6 despite its peerDependency to cds 8 is not the desired behaviour and will lead to problems. I will investigate this. Best, |
@chgeo FYI |
related: #136 |
thanks for pointing out this incompatibility with cds7 projects. The problem stems from an open dependency range in cds7 which we will fix asap. |
@daogrady that's seems to be the case I was worried about yesterday in out discussion. |
Thanks for the fix. Initializing a sample project with CDS@8 works fine now with this this fix.
|
@daogrady, @chgeo |
Could point. Should check if this is more robust. |
Hi @devinea, thanks for the suggestion! While I see the general appeal of the more generic approach, I have a hard time seeing the case in this specific scenario. As the script is executed as part of the installation of Best, |
Hi everyone, has been rather quiet around the install script lately, so I assume this has been fixed for now. Therefore closing the issue. 🙂 Best, |
Is there an existing issue for this?
Current Behavior
Currently when enabling @sap/cds with typescript (using cds --add typescript, typer) and after reinstalling the dependencies, the post installation script doesn't create the symbolic link to the @types folder.
This results in not being able to use the following statement in ts files: import cds from '@sap/cds'.
This can be fixed by manually creating the symbolic link as follows (on Linux):
ln -s /workspaces/advanced-output-management/node_modules/@cap-js/cds-types node_modules/@types/sap__cds
I'm running the project in a dev container with image: mcr.microsoft.com/devcontainers/typescript-node:1-20-bookworm
Expected Behavior
The post install script to automatically create the necessary symbolic link
References
not applicable
Versions
Anything else? Logs?
Devcontainer.json configuration:
The text was updated successfully, but these errors were encountered: