diff --git a/.eslintrc b/.eslintrc index 79cf25fe..7e6f79e2 100644 --- a/.eslintrc +++ b/.eslintrc @@ -6,7 +6,7 @@ "jest": true }, "parserOptions": { - "ecmaVersion": 2017 + "ecmaVersion": 2018 }, "globals": { "SELECT": true, diff --git a/.npmrc b/.npmrc index 43c97e71..6041b7e8 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1 @@ -package-lock=false +@sap:registry=https://npm.sap.com \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index bd2108f4..c810af37 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,19 +5,17 @@ "version": "0.2.0", "configurations": [ { - "name": "cds run", - "request": "launch", - "type": "node", - "runtimeExecutable": "npx", - "runtimeArgs": ["-n"], - "args": ["--", "cds", "run", "--with-mocks", "--in-memory?"], // the leading "--" arg ensures it works with as well as without debugging + "name": "bookshop", "request": "launch", "type": "node", "runtimeExecutable": "npx", "runtimeArgs": [ "-n" ], + "args": [ "--", "cds", "run", "--in-memory" ], + "cwd": "${workspaceFolder}/packages/bookshop", + "console": "integratedTerminal", + "skipFiles": ["/**"] + }, + { + "name": "cds run ...", "request": "launch", "type": "node", "runtimeExecutable": "npx", "runtimeArgs": [ "-n" ], + "args": [ "--", "cds", "run", "--with-mocks", "--in-memory?" ], "cwd": "${workspaceFolder}/packages/${input:service}", "console": "integratedTerminal", - "serverReadyAction": { - "pattern": "server listening on (https?://\\S+|[0-9]+)", - "uriFormat": "http://localhost:%s", - "action": "openExternally" - }, "skipFiles": ["/**"] } ], @@ -31,12 +29,9 @@ "bookstore", "media-server", "office-supplies", - "orders-service", - "products-service", - "reviews-service", - "user-service" + "reviews-service" ], - "default": "bookstore" + "default": "bookshop" } ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 10800472..72bc8cb5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,6 @@ { "files.exclude": { - "**/.gitignore": false, - "**/.git": false, - "**/.vscode": false + "**/.gitignore": true, + "**/.vscode": true } } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 47e028a5..c507ca84 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,23 +4,14 @@ "version": "2.0.0", "tasks": [ { - "type": "shell", "label": "cds run bookshop", - "command": "npx", "args": [ "cds", "watch", "packages/bookshop" ], - "presentation": { "group": "A" }, - "problemMatcher": [] + "type": "npm", "script": "watch", "path": "packages/bookshop/", + "options": { "env": { "PORT": "4004" }}, + "presentation": { "group": "A" } }, { - "type": "shell", "label": "cds run bookshop-enhanced", - "command": "npx", "args": [ "cds", "watch", "packages/bookshop-enhanced" ], - "presentation": { "group": "A" }, - "problemMatcher": [] - }, - { - "type": "shell", "label": "cds run reviews-service", - "command": "npx", "args": [ "cds", "watch", "packages/reviews-service" ], - "options": {"env": { "PORT":"5005" }}, - "presentation": { "group": "A" }, - "problemMatcher": [] + "type": "npm", "script": "watch", "path": "packages/reviews-service/", + "options": { "env": { "PORT": "5005" }}, + "presentation": { "group": "A" } } ] } \ No newline at end of file diff --git a/README.md b/README.md index 923f43d9..035f076c 100644 --- a/README.md +++ b/README.md @@ -17,15 +17,13 @@ The samples provided can be run in a local setup on SQLite Database. #### Optional (if you want to import the code into an editor) * [VS Code](https://code.visualstudio.com) -* [Add CDS extension to VS](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/be944d6d51f343f6b3f53c29c44ff00a.html) +* [Add CDS extension to VS](https://cap.cloud.sap/docs/get-started/in-vscode#add-cds-editor) ## Download and Installation #### Install `cds` development kit ```sh -# sets the registry for `@sap` packages -npm set @sap:registry=https://npm.sap.com - +# `@sap`-scoped packages are set via .npmrc npm install -g @sap/cds-dk cds #> test-run it ``` diff --git a/package.json b/package.json index ac556d5f..499371c6 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "bookshop": "cds watch packages/bookshop", "bookshop-enhanced": "cds watch packages/bookshop-enhanced", "reviews-service": "cds watch packages/reviews-service", + "bookstore": "cds watch packages/bookstore", "media-server": "cds watch packages/media-server" }, diff --git a/packages/bookshop-enhanced/package.json b/packages/bookshop-enhanced/package.json index 008da347..94c0ae7e 100644 --- a/packages/bookshop-enhanced/package.json +++ b/packages/bookshop-enhanced/package.json @@ -11,7 +11,9 @@ "express": "*" }, "scripts": { - "start": "npx cds run" + "reviews-service": "PORT=5005 cds run ../reviews-service --bind --in-memory?", + "start": "cds run --in-memory?", + "watch": "cds watch" }, "cds": { "requires": { diff --git a/packages/bookshop/app/fiori.html b/packages/bookshop/app/fiori.html index 09db455d..2fc2a0d4 100644 --- a/packages/bookshop/app/fiori.html +++ b/packages/bookshop/app/fiori.html @@ -43,7 +43,7 @@