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

Add description for typescript facet and build script #971

Merged
merged 12 commits into from
Sep 17, 2024

Conversation

daogrady
Copy link
Contributor

@daogrady daogrady commented Jun 3, 2024

  1. Adds a description for how to use cds add typescript
  2. Adds a description for using cds build with TypeScript (which replaces the steps that formerly had to be done manually)
  3. Updates the output for cds-typer --help

node.js/typescript.md Outdated Show resolved Hide resolved
tools/cds-typer.md Outdated Show resolved Hide resolved
daogrady and others added 2 commits June 5, 2024 08:47
node.js/typescript.md Outdated Show resolved Hide resolved
Co-authored-by: Lothar Bender <lothar.bender@sap.com>
Co-authored-by: René Jeglinsky <rene.jeglinsky@sap.com>
tools/cds-typer.md Outdated Show resolved Hide resolved
tools/cds-typer.md Outdated Show resolved Hide resolved
daogrady and others added 4 commits September 16, 2024 12:44
Co-authored-by: René Jeglinsky <rene.jeglinsky@sap.com>
Co-authored-by: René Jeglinsky <rene.jeglinsky@sap.com>
@renejeglinsky renejeglinsky merged commit eeeab98 into main Sep 17, 2024
4 checks passed
@renejeglinsky renejeglinsky deleted the doc/typescript-build-and-facet branch September 17, 2024 07:09
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./gen/srv",
Copy link
Contributor

@LotharBender LotharBender Sep 17, 2024

Choose a reason for hiding this comment

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

@daogrady - outDir seems to match the default value and might not need to be configured. Reading the
value from the cds configuration might even be more robust:
path.join(cds.env.build.target, cds.env.folders.srv)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔 I don't think we can dynamically add values here, as this is the recommendation for the basic layout of a tsconfig.json, which is a static file.

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought the typescript build task could calculate the default path if outDir isn't set.
Of course, this is only an option if outDir isn't used by the typescript compiler itself which seems to be the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you are correct about that! 🙂
But this part of the documentation is about a tsconfig.json the user could manually create to configure how the build task works, hence the preamble "We recommend the following basic setup for such a file:".

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.

3 participants