-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 41f3d47
Showing
22 changed files
with
1,752 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
ARG VARIANT="20" | ||
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT} | ||
ARG CAPVER="latest" | ||
|
||
# Install some generally useful tools | ||
RUN apt-get update \ | ||
&& apt-get -y install --no-install-recommends \ | ||
curl git sqlite3 entr source-highlight | ||
|
||
# Install SAP CAP SDK globally | ||
USER node | ||
RUN npm install -g @sap/cds-dk@$CAPVER | ||
|
||
# vi mode everywhere and nicer prompt KTHXBAI | ||
RUN cat <<EOBASHRC >> /home/node/.bashrc | ||
export EDITOR=vi | ||
set -o vi | ||
bind -x '"\C-l": clear' | ||
EOBASHRC | ||
|
||
RUN echo 'export PS1=${PS1/\$ /\\\\n$ }' >> /home/node/.bashrc | ||
|
||
# Ready! | ||
WORKDIR /home/node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "Back to basics - SAP CAP - dev container", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"args": { | ||
"VARIANT": "20" | ||
} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"sapse.vscode-cds", | ||
"dbaeumer.vscode-eslint", | ||
"humao.rest-client", | ||
"qwtel.sqlite-viewer", | ||
"mechatroner.rainbow-csv" | ||
] | ||
} | ||
}, | ||
"forwardPorts": [ | ||
4004 | ||
], | ||
"remoteUser": "node" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# CAP capb2b-main | ||
_out | ||
*.db | ||
*.sqlite | ||
connection.properties | ||
default-*.json | ||
.cdsrc-private.json | ||
gen/ | ||
node_modules/ | ||
target/ | ||
|
||
# Web IDE, App Studio | ||
.che/ | ||
.gen/ | ||
|
||
# MTA | ||
*_mta_build_tmp | ||
*.mtar | ||
mta_archives/ | ||
|
||
# Other | ||
.DS_Store | ||
*.orig | ||
*.log | ||
|
||
*.iml | ||
*.flattened-pom.xml | ||
|
||
# IDEs | ||
# .vscode | ||
# .idea | ||
|
||
# @cap-js/cds-typer | ||
@cds-models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"recommendations": [ | ||
"SAPSE.vscode-cds", | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"mechatroner.rainbow-csv", | ||
"qwtel.sqlite-viewer", | ||
"humao.rest-client" | ||
], | ||
"unwantedRecommendations": [ | ||
|
||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "cds serve", | ||
"request": "launch", | ||
"type": "node", | ||
"cwd": "${workspaceFolder}", | ||
"runtimeExecutable": "cds", | ||
"args": [ | ||
"serve", | ||
"--with-mocks", | ||
"--in-memory?" | ||
], | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
// uncomment entries once all libraries have been installed via 'npm install' | ||
"eslint.validate": [ | ||
// "cds", | ||
// "csn", | ||
// "csv", | ||
// "csv (semicolon)", | ||
// "tab", | ||
// "tsv" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "shell", | ||
"label": "cds watch", | ||
"command": "cds", | ||
"args": ["watch"], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "shell", | ||
"label": "cds serve", | ||
"command": "cds", | ||
"args": ["serve", "--with-mocks", "--in-memory?"], | ||
"problemMatcher": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Getting Started | ||
|
||
Welcome to your new project. | ||
|
||
It contains these folders and files, following our recommended project layout: | ||
|
||
File or Folder | Purpose | ||
---------|---------- | ||
`app/` | content for UI frontends goes here | ||
`db/` | your domain models and data go here | ||
`srv/` | your service models and code go here | ||
`package.json` | project metadata and configuration | ||
`readme.md` | this getting started guide | ||
|
||
|
||
## Next Steps | ||
|
||
- Open a new terminal and run `cds watch` | ||
- (in VS Code simply choose _**Terminal** > Run Task > cds watch_) | ||
- Start adding content, for example, a [db/schema.cds](db/schema.cds). | ||
|
||
|
||
## Learn More | ||
|
||
Learn more at https://cap.cloud.sap/docs/get-started/. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// removed the key and decorated each of the entities with aspects | ||
// aspects for entities with canonical user id | ||
using {cuid, managed} from '@sap/cds/common'; | ||
|
||
service bookshop { | ||
entity Books{ | ||
key ID: Integer; | ||
title: String; | ||
} | ||
|
||
entity Authors{ | ||
key ID: Integer; | ||
name: String; | ||
} | ||
|
||
} | ||
|
||
|
||
// service bookshop { | ||
// entity Books { | ||
// key ID: Integer; | ||
// title: String; | ||
// } | ||
|
||
// entity Authors { | ||
// key ID: Integer; | ||
// name: String; | ||
// } | ||
|
||
// entity Customer { | ||
// key ID: Integer; | ||
// name: String; | ||
// email: String; | ||
// } | ||
|
||
// } | ||
|
||
// "cds": { | ||
// "requires": { | ||
// "db": { | ||
// "kind": "sqlite", | ||
// "credentials": { | ||
// "url": "bookshop.sqlite" | ||
// } | ||
// } | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// this will generate new line at the end | ||
// console.log(require("crypto").randomUUID()) | ||
// console.log(require("crypto").randomUUID()) | ||
|
||
// // does not generate a new line | ||
// process.stdout.write(require("crypto").randomUUID()) | ||
// process.stdout.write(require("crypto").randomUUID()) | ||
|
||
// if (require('tty').isatty(process.stdout.fd)){ | ||
// // if in terminal | ||
// console.log(require("crypto").randomUUID()) | ||
// } else { | ||
// // if not terminal: code editor | ||
// process.stdout.write(require("crypto").randomUUID()) | ||
// } | ||
|
||
console.log(require("crypto").randomUUID()) | ||
console.log(require("crypto").randomUUID()) | ||
console.log(require("crypto").randomUUID()) | ||
console.log(require("crypto").randomUUID()) |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ID, name | ||
0118aff8e4-8f6f-40cd-b3c5-c62c0c3d8743, Douglas Noel Adams | ||
a93e6d73-5d6a-45da-89f9-780518daadc9, Iain M. Banks | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ID, title, author_ID | ||
d6b44ec8-bcce-4fbe-acdf-de91b3920821, The Hitch Hiker's Galaxy, 0118aff8e4-8f6f-40cd-b3c5-c62c0c3d8743 | ||
bec72439-2921-44a1-9209-4823d368eaef, Mostly Harmless, 0118aff8e4-8f6f-40cd-b3c5-c62c0c3d8743 | ||
7064717-de0d-4bcd-9113-a5316e1885ae, The player of Games, a93e6d73-5d6a-45da-89f9-780518daadc9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import cds from '@sap/cds/eslint.config.mjs' | ||
export default [ ...cds.recommended ] |
Oops, something went wrong.