Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .vitepress/theme/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ footer {

/* expand width on big screens */
@media screen and (min-width: 1600px) {
div[class*='language-']:hover,
div[class*='language-']:focus,
div[class*='language-']:not(.vp-code-group div[class*='language-']):hover,
div[class*='language-']:not(.vp-code-group div[class*='language-']):focus,
pre.log:hover,
pre.log:focus {
min-width: fit-content;
Expand All @@ -439,7 +439,7 @@ footer {
tr {
z-index: 1; position: relative; // draw wide rows over outline
}
[class*='language-'] pre {
[class*='language-']:not(.vp-code-group [class*='language-']) pre {
overflow: hidden !important;
}
// expand navbar to cover wide content (see java/development/properties)
Expand All @@ -461,6 +461,19 @@ footer {
}
}

/* Hide scrollbars by default, show on hover */
[class*='language-'] pre,
pre.log {
scrollbar-width: none;
&::-webkit-scrollbar { display: none; }
}

[class*='language-']:hover pre,
pre.log:hover {
scrollbar-width: thin;
&::-webkit-scrollbar { display: block; }
}

@media print {
.VPNav, .VPSidebar, .VPDocAside, .VPDocFooter {
display: none !important;
Expand Down
140 changes: 108 additions & 32 deletions get-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,71 +12,135 @@ Jumpstart & Grow as You Go... {.subtitle}

A most minimalistic setup needs [CAP's _cds-dk_](https://www.npmjs.com/package/@sap/cds-dk) installed, which in turn requires [Node.js](https://nodejs.org). Add optional setups for [Java](https://sapmachine.io), [GitHub](https://github.com), and [Visual Studio Code](https://code.visualstudio.com), as appropriate, and as outlined below.

On macOS (and Linux), we recommend using [Homebrew](https://brew.sh), and run the commands in the subsequent sections in your terminal to get everything set up.
### Preparation

```shell
bash -c "$( curl https://raw.githubusercontent.com/homebrew/install/HEAD/install.sh )"
```
On macOS, Linux and WSL (Windows Subsystem for Linux), we recommend using [Homebrew](https://brew.sh), and run the commands in the subsequent sections in your terminal to get everything set up.
On Windows PowerShell you can use the built-in `WinGet` command.

::: details Alternative setup (required on Windows) ...

Instead of using Homebrew – which is not available on Windows –, you can manually download and install the required packages from their respective websites:

| Package | Install from | Remarks |
|---------|----------------------------------|---------------------------------------------------------|
| Node.js | https://nodejs.org | _required_ |
| Java | https://sapmachine.io | _optional_ |
| Git | https://git-scm.com | _optional_ |
| VS Code | https://code.visualstudio.com | + [recommended extensions](../tools/cds-editors#vscode) |
| SQLite | https://sqlite.org/download.html | _required_ on Windows |

Then install CAP's _cds-dk_ globally:

```shell
npm add -g @sap/cds-dk
```
::: code-group
```shell [macOS / Linux / WSL]
# silently install
# curl (required to get Homebrew)
# git (required by Homebrew)
# just for completeness, this might already be installed on your machine
sudo apt install curl git -y
bash -c "$( curl https://raw.githubusercontent.com/homebrew/install/HEAD/install.sh )"
```
:::


<style scoped>
.required::before { content: 'Required:'; color: #999; margin-right: 0.5em }
.optional::before { content: 'Optional:'; color: #999; margin-right: 0.5em }
.proposed::before { content: 'Proposed:'; color: #999; margin-right: 0.5em }
</style>



### Node.js and _cds-dk_ {.required}

::: code-group
```shell [macOS / Linux / WSL]
brew install node # Node.js LTS
```
```PowerShell [Windows]
winget install --silent OpenJS.NodeJS.LTS
# restart PowerShell to activate the new command
```
:::
```shell
brew install node # Node.js
npm i -g @sap/cds-dk # CAP's cds-dk
npm i -g @sap/cds-dk # install CAP's cds-dk globally
cds -v # check cds version
```
Comment on lines +40 to 52
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm still wondering if I like that or if I'd rather see the common part (even if redundant) in each of the code groups.

Image


### SQLite (Windows) {.required}

::: code-group
```PowerShell [Windows]
winget install --silent SQLite.SQLite
# restart PowerShell to activate the new command
sqlite3 -version
```
:::

### Java and Maven {.optional}

```shell
::: code-group
```shell [macOS / Linux / WSL]
brew install sapmachine-jdk
brew install maven
```

```PowerShell [Windows]
winget install --silent SAP.SapMachine.25.JDK

# Apache Maven is not available using winget so download it directly
$v="3.9.12"; `
$url="https://dlcdn.apache.org/maven/maven-3/$v/binaries/apache-maven-$v-bin.zip"; `
$mvnzip="$env:LOCALAPPDATA\maven.zip"; `
curl $url -o $mvnzip; `
tar -xf $mvnzip -C "$env:LOCALAPPDATA"; `
setx PATH "$env:PATH;$env:LOCALAPPDATA\apache-maven-$v\bin"; `
rm $mvnzip
Comment on lines +74 to +81
Copy link
Contributor

Choose a reason for hiding this comment

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

I got a warning that copying multiple lines could lead to unexpected execution. I did so nevertheless and it worked. I was just asking myself if we are confident enough to mention that and let people say "Ok"?

# restart PowerShell to activate the new commands
```
:::
```shell
mvn -version # display Maven and Java versions
```

### Git and GitHub {.optional}

```shell
brew install git # Git CLI
::: code-group
```shell [macOS / Linux / WSL]
brew install git # Git CLI (for completeness, already installed for Homebrew)
brew install gh # GitHub CLI
```
```PowerShell [Windows]
winget install --silent Git.Git
winget install --silent GitHub.cli
# restart PowerShell to activate the new commands
```
:::
::: code-group
```shell [macOS]
brew install github # GitHub Desktop App
```

```shell [Linux / WSL]
# Github-Desktop on Homebrew is only supported for macOS
GHD_VERSION="3.3.12"
curl -L \
https://github.com/shiftkey/desktop/releases/download/release-${GHD_VERSION}-linux1/GitHubDesktop-linux-amd64-${GHD_VERSION}-linux1.deb \
-o github-desktop.deb
sudo apt install ./github-desktop.deb
rm ./github-desktop.deb
```
```PowerShell [Windows]
winget install --silent GitHub.GitHubDesktop
# restart PowerShell to activate the new commands
```
:::
```shell
git -v # display Git cli version
```


### Visual Studio Code {.proposed}

::: code-group
```shell [macOS]
brew install --cask visual-studio-code # VS Code itself
```
```bash [Linux / WSL]
# VS Code on Homebrew is only supported for macOS
sudo snap install --classic code
```
```PowerShell [Windows]
winget install --silent Microsoft.VisualStudioCode
# restart PowerShell to activate the new command
```
:::
```shell
brew install --cask visual-studio-code # VS Code itself
code -v # display VS Code's version
```

#### Visual Studio Code proposed extensions {.proposed}
```shell
code --install-extension sapse.vscode-cds # for .cds models
code --install-extension mechatroner.rainbow-csv # for .csv files
Expand All @@ -92,6 +156,18 @@ code --install-extension vscjava.vscode-maven # for Maven

> You can of course also use other IDEs or editors of your choice, such as [IntelliJ IDEA](https://www.jetbrains.com/idea/), for which we also provide [support](../tools/cds-editors#intellij). Yet we strongly recommend Visual Studio Code for the best experience with CAP.

::: details Alternative setup ...

You can also manually download and install the required packages from their respective websites:

| Package | Install from | Remarks |
|---------|----------------------------------|---------------------------------------------------------|
| Node.js | https://nodejs.org | _required_ |
| Java | https://sapmachine.io | _optional_ |
| Git | https://git-scm.com | _optional_ |
| VS Code | https://code.visualstudio.com | + [recommended extensions](../tools/cds-editors#vscode) |
| SQLite | https://sqlite.org/download.html | _required_ on Windows |
:::

## Command Line Interface

Expand Down