diff --git a/.vscode/launch.json b/.vscode/launch.json index 4ff1fabc..554bf57c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,35 +5,19 @@ "version": "0.2.0", "configurations": [ { - "name": "bookshop", - "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", - "serverReadyAction": { - "pattern": "server listening on (https?://\\S+|[0-9]+)", - "uriFormat": "http://localhost:%s", - "action": "openExternally" - }, "skipFiles": ["/**"] }, { - "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": "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": ["/**"] } ], @@ -47,12 +31,9 @@ "bookstore", "media-server", "office-supplies", - "orders-service", - "products-service", - "reviews-service", - "user-service" + "reviews-service" ], - "default": "bookstore" + "default": "bookshop" } ] } 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/package.json b/package.json index 08b90658..017d41aa 100644 --- a/package.json +++ b/package.json @@ -5,23 +5,23 @@ "author": "daniel.hutzel@sap.com", "private": true, "scripts": { - "cleanup": "lerna clean -y && rm -fr node_modules", - "install": "(npm -s run lerna) && lerna bootstrap --hoist", "lerna": "npx --no-install lerna -v > /dev/null || npm i lerna --no-save", - "test": "jest", - "bookshop-enhanced": "cds watch packages/bookshop-enhanced", + "install": "(npm -s run lerna) && lerna bootstrap --hoist", + "cleanup": "lerna clean -y && rm -fr node_modules", "bookshop": "cds watch packages/bookshop", - "bookstore": "cds watch packages/bookstore", - "products-service": "cds watch packages/products-service", - "reviews-service": "cds watch packages/reviews-service" + "bookshop-enhanced": "cds watch packages/bookshop-enhanced", + "reviews-service": "cds watch packages/reviews-service", + "bookstore": "cds watch packages/bookstore" }, "dependencies": { "@sap/cds": "latest", "express": "*" }, + "devDependencies": { + "sqlite3": "*" + }, "--add-these-to-devDependencies-for-tests": { "@types/jest": "*", - "sqlite3": "*", "jest": "*" }, "license": "SAP SAMPLE CODE LICENSE" 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/package.json b/packages/bookshop/package.json index 13fed520..b3161ac9 100644 --- a/packages/bookshop/package.json +++ b/packages/bookshop/package.json @@ -11,7 +11,8 @@ "sqlite3": "^4.1.0" }, "scripts": { - "start": "npx cds run" + "start": "cds run --in-memory?", + "watch": "cds watch" }, "cds": { "requires": { diff --git a/packages/bookstore/package.json b/packages/bookstore/package.json index e36dc529..0f18561b 100644 --- a/packages/bookstore/package.json +++ b/packages/bookstore/package.json @@ -28,7 +28,8 @@ "app", "srv", "db" ], "scripts": { - "start": "cds run" + "start": "cds run --in-memory?", + "watch": "cds watch" }, "cds": { "requires": { diff --git a/packages/reviews-service/package.json b/packages/reviews-service/package.json index 45f3194d..990f4e35 100644 --- a/packages/reviews-service/package.json +++ b/packages/reviews-service/package.json @@ -8,6 +8,10 @@ "@sap/cds": "latest", "express": "*" }, + "scripts": { + "start": "cds run --in-memory?", + "watch": "cds watch" + }, "files": [ "db", "srv",