Skip to content

feat: added support for multi-project setups#592

Open
Vo1dSh4d0w wants to merge 2 commits into
cap-js:mainfrom
Vo1dSh4d0w:main
Open

feat: added support for multi-project setups#592
Vo1dSh4d0w wants to merge 2 commits into
cap-js:mainfrom
Vo1dSh4d0w:main

Conversation

@Vo1dSh4d0w

Copy link
Copy Markdown

Hello,

these changes allow multi-project setups to be compiled using cds-typer. We need this change, because our project structure does not exactly match the structure in our target directory (gen), therefore we have a tsconfig each for our 2 separated projects.

With these changes, in order to build 2 projects, the build defintion has to be modified manually, for example:

  "build": {
    "target": "gen",
    "tasks": [
      {
        "for": "hana",
        "src": "db"
      },
      {
        "for": "nodejs",
        "src": "srv"
      },
      {
        "for": "mtx-sidecar",
        "src": "mtx/sidecar"
      },
      { "for": "typescript" },
      { "for": "typescript", "src": "mtx/sidecar", "dest": "mtx/sidecar" }
    ]
  }

This change works by joining every project related path (like tsconfig.cdsbuild.json) with the configured "src", I've also added a check to the configured "dest", which ensures that a custom "dest" won't be overwritten in the "init()" function.

I've tested this patch both with our real project and with a smaller project without any explicit build configuration.

@github-actions

Copy link
Copy Markdown
Contributor

This PR has not been updated in a while. If it is still relevant, please comment on it to keep it open. The PR will be closed soon if it remains inactive.

@github-actions github-actions Bot added the stale label Apr 24, 2026
@daogrady daogrady removed the stale label Apr 29, 2026
@daogrady

Copy link
Copy Markdown
Contributor

Hi Filip,

thanks for pointing this scenario out and for providing a fix.
The change looks good on first glance, please just address the failing workflows.

Also, could you please let me know why your projects need differing layouts? This is a use case we have not yet encountered.

Best,
Daniel

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.

2 participants