Compare commits

..

11 Commits

Author SHA1 Message Date
Christian Georgi
ce3aaa778f Enforce eslint 9, fix config 2024-04-15 14:33:27 +02:00
Mara Kiefer
2861c80e16 Update eslint.config.js 2024-04-15 14:24:28 +02:00
Mara Kiefer
b2c26278b5 Update package.json 2024-04-15 14:21:13 +02:00
Mara Kiefer
11b43a924d Update eslint.config.js 2024-04-15 08:55:06 +02:00
Mara Kiefer
48173c75ed Update package.json 2024-04-15 08:24:42 +02:00
Mara Kiefer
b59997aa47 Update package.json 2024-04-15 08:22:48 +02:00
Mara Kiefer
a30cfefd88 Update eslint.config.js 2024-04-12 08:45:51 +02:00
Mara Kiefer
8887c614d8 Update eslint.config.js 2024-04-12 08:42:25 +02:00
Mara Kiefer
3f78e8249f Update eslint.config.js 2024-04-12 08:41:07 +02:00
Mara Kiefer
b584de02a3 Update eslint.config.js 2024-04-12 08:38:39 +02:00
Mara Kiefer
6a6b498d9a Create eslint.config.js 2024-04-11 13:35:42 +02:00
19 changed files with 100 additions and 753 deletions

View File

@@ -1,43 +0,0 @@
_schema-version: '3.1'
ID: capire.bookstore
version: 1.0.0
description: "A simple CAP project."
parameters:
enable-parallel-deployments: true
build-parameters:
before-all:
- builder: custom
commands:
- npm ci
- npx cds build --production
modules:
- name: bookstore-srv
type: nodejs
path: gen/srv
parameters:
buildpack: nodejs_buildpack
readiness-health-check-type: http
readiness-health-check-http-endpoint: /health
build-parameters:
builder: npm
provides:
- name: srv-api # required by consumers of CAP services (e.g. approuter)
properties:
srv-url: ${default-url}
requires:
- name: bookstore-destination
- name: bookstore-messaging
- name: samples-db
resources:
- name: bookstore-destination
type: org.cloudfoundry.managed-service
parameters:
service: destination
service-plan: lite
- name: bookstore-messaging
type: org.cloudfoundry.managed-service
parameters:
service: enterprise-messaging
service-plan: default
path: ./event-mesh.json

View File

@@ -21,32 +21,14 @@
"model": "@capire/orders"
},
"messaging": {
"[development]": {
"kind": "file-based-messaging"
},
"[hybrid]": {
"kind": "enterprise-messaging-shared"
},
"[production]": {
"kind": "enterprise-messaging"
}
"[development]": { "kind": "file-based-messaging" },
"[hybrid]": { "kind": "enterprise-messaging-shared" },
"[production]": { "kind": "enterprise-messaging" }
},
"db": { "kind": "sql" },
"[multimodule]": {
"db": {
"kind": "sqlite",
"impl": "@cap-js/sqlite",
"credentials": {
"url": "../db.sqlite"
}
}
"db": {
"kind": "sql"
}
},
"log": {
"service": true
}
},
"devDependencies": {
"@sap/cds-dk": "^7"
"log": { "service": true }
}
}
}

View File

@@ -1,5 +0,0 @@
using from '@capire/bookstore';
using from '@capire/common';
using from '@capire/orders';
using from '@capire/reviews';
using from '@capire/fiori';

27
eslint.config.js Normal file
View File

@@ -0,0 +1,27 @@
const globals = require("globals");
const js = require('@eslint/js');
const cds = require('@sap/eslint-plugin-cds');
module.exports = [
cds.configs.recommended,
{
"files": ["**/*.js"],
...js.configs.recommended,
"languageOptions": {
"globals": {
...globals.browser,
...globals.node,
...globals.jest,
...globals.mocha,
"es2022": true
},
},
"rules": {
...js.configs.recommended.rules,
"no-console": "off",
"require-atomic-updates": "off",
"require-await": "warn",
"no-unused-vars": ["warn", { "argsIgnorePattern": "_" }]
}
}
]

View File

@@ -1,12 +0,0 @@
{
"name": "approuter",
"dependencies": {
"@sap/approuter": "^16.0.0"
},
"engines": {
"node": "^20.0.0"
},
"scripts": {
"start": "node node_modules/@sap/approuter/approuter.js"
}
}

View File

@@ -1,22 +0,0 @@
{
"welcomeFile": "app/index.html",
"routes": [
{
"source": "^/app/(.*)$",
"target": "$1",
"localDir": ".",
"cacheControl": "no-cache, no-store, must-revalidate"
},
{
"source": "^/appconfig/",
"localDir": ".",
"cacheControl": "no-cache, no-store, must-revalidate"
},
{
"source": "^/(.*)$",
"target": "$1",
"destination": "srv-api",
"csrfProtection": true
}
]
}

View File

@@ -1,2 +1 @@
using from './db/common';
using from './app/services';

View File

@@ -1,69 +0,0 @@
_schema-version: '3.1'
ID: capire.fiori
version: 1.0.0
description: "A simple CAP project."
parameters:
enable-parallel-deployments: true
build-parameters:
before-all:
- builder: custom
commands:
- npm ci
- npx cds build --production
modules:
- name: fiori-srv
type: nodejs
path: gen/srv
parameters:
buildpack: nodejs_buildpack
readiness-health-check-type: http
readiness-health-check-http-endpoint: /health
build-parameters:
builder: npm
provides:
- name: srv-api # required by consumers of CAP services (e.g. approuter)
properties:
srv-url: ${default-url}
requires:
- name: fiori-auth
- name: fiori-destination
- name: fiori-messaging
- name: samples-db
- name: fiori
type: approuter.nodejs
path: app/router
parameters:
keep-existing-routes: true
disk-quota: 256M
memory: 256M
requires:
- name: srv-api
group: destinations
properties:
name: srv-api # must be used in xs-app.json as well
url: ~{srv-url}
forwardAuthToken: true
- name: fiori-auth
resources:
- name: fiori-auth
type: org.cloudfoundry.managed-service
parameters:
service: xsuaa
service-plan: application
path: ./xs-security.json
config:
xsappname: fiori-${org}-${space}
tenant-mode: dedicated
- name: fiori-destination
type: org.cloudfoundry.managed-service
parameters:
service: destination
service-plan: lite
- name: fiori-messaging
type: org.cloudfoundry.managed-service
parameters:
service: enterprise-messaging
service-plan: default
path: ./event-mesh.json

View File

@@ -38,15 +38,6 @@
"db": {
"kind": "sql"
},
"[multimodule]": {
"db": {
"kind": "sqlite",
"impl": "@cap-js/sqlite",
"credentials": {
"url": "../db.sqlite"
}
}
},
"db-ext": {
"[development]": {
"model": "db/sqlite"

View File

@@ -1,22 +0,0 @@
{
"scopes": [
{
"name": "$XSAPPNAME.emcallback",
"description": "Enterprise-Messaging Callback Access",
"grant-as-authority-to-apps": [
"$XSSERVICENAME(fiori-messaging)"
]
},
{
"name": "$XSAPPNAME.emmanagement",
"description": "Enterprise-Messaging Management Access"
}
],
"attributes": [],
"role-templates": [],
"authorities-inheritance": false,
"authorities": [
"$XSAPPNAME.emmanagement",
"$XSAPPNAME.mtcallback"
]
}

View File

@@ -1,27 +0,0 @@
_schema-version: '3.1'
ID: capire.samples
version: 2.0.0
description: "A monorepo with several samples for CAP."
parameters:
enable-parallel-deployments: true
build-parameters:
before-all:
- builder: custom
commands:
- npm ci
- npx cds build --production --ws
modules:
- name: samples-db-deployer
type: hdb
path: gen/db
parameters:
buildpack: nodejs_buildpack
requires:
- name: samples-db
resources:
- name: samples-db
type: com.sap.xs.hdi-container
parameters:
service: hana
service-plan: hdi-shared

View File

@@ -1,12 +0,0 @@
{
"name": "approuter",
"dependencies": {
"@sap/approuter": "^16.0.0"
},
"engines": {
"node": "^20.0.0"
},
"scripts": {
"start": "node node_modules/@sap/approuter/approuter.js"
}
}

View File

@@ -1,22 +0,0 @@
{
"welcomeFile": "app/index.html",
"routes": [
{
"source": "^/app/(.*)$",
"target": "$1",
"localDir": ".",
"cacheControl": "no-cache, no-store, must-revalidate"
},
{
"source": "^/appconfig/",
"localDir": ".",
"cacheControl": "no-cache, no-store, must-revalidate"
},
{
"source": "^/(.*)$",
"target": "$1",
"destination": "srv-api",
"csrfProtection": true
}
]
}

View File

@@ -1,55 +0,0 @@
_schema-version: '3.1'
ID: capire.orders
version: 1.0.0
description: "A simple CAP project."
parameters:
enable-parallel-deployments: true
build-parameters:
before-all:
- builder: custom
commands:
- npm ci
- npx cds build --production
modules:
- name: orders-srv
type: nodejs
path: gen/srv
parameters:
buildpack: nodejs_buildpack
readiness-health-check-type: http
readiness-health-check-http-endpoint: /health
build-parameters:
builder: npm
provides:
- name: srv-api # required by consumers of CAP services (e.g. approuter)
properties:
srv-url: ${default-url}
requires:
- name: orders-auth
- name: orders
type: approuter.nodejs
path: app/router
parameters:
keep-existing-routes: true
disk-quota: 256M
memory: 256M
requires:
- name: srv-api
group: destinations
properties:
name: srv-api # must be used in xs-app.json as well
url: ~{srv-url}
forwardAuthToken: true
- name: orders-auth
resources:
- name: orders-auth
type: org.cloudfoundry.managed-service
parameters:
service: xsuaa
service-plan: application
path: ./xs-security.json
config:
xsappname: orders-${org}-${space}
tenant-mode: dedicated

View File

@@ -4,19 +4,5 @@
"dependencies": {
"@capire/common": "*",
"@sap/cds": ">=5"
},
"cds": {
"requires": {
"db": { "kind": "sql" },
"[multimodule]": {
"db": {
"kind": "sqlite",
"impl": "@cap-js/sqlite",
"credentials": {
"url": "../db.sqlite"
}
}
}
}
}
}
}

View File

@@ -1,5 +0,0 @@
{
"scopes": [],
"attributes": [],
"role-templates": []
}

447
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,6 @@
"repository": "https://github.com/sap-samples/cloud-cap-samples.git",
"author": "daniel.hutzel@sap.com",
"dependencies": {
"@sap-cloud-sdk/resilience": "^3.14.0",
"@sap/cds": ">=7"
},
"workspaces": [
@@ -22,12 +21,12 @@
],
"devDependencies": {
"@cap-js/sqlite": "^1",
"@sap/cds-dk": "^7",
"@sap/eslint-plugin-cds": "^2.6.1",
"@sap/eslint-plugin-cds": "^3",
"axios": "^1",
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
"chai-subset": "^1.6.0",
"eslint": "^9",
"semver": "^7"
},
"scripts": {
@@ -53,16 +52,6 @@
"parallel": true,
"timeout": 6666
},
"cds": {
"requires": {
"db": {
"kind": "sql",
"[development]": {
"model": "db/sqlite"
}
}
}
},
"license": "SEE LICENSE IN LICENSE",
"private": true
}

View File

@@ -17,17 +17,7 @@
"[hybrid]": { "kind": "enterprise-messaging-shared" },
"[production]": { "kind": "enterprise-messaging" }
},
"db": { "kind": "sql" },
"[multimodule]": {
"db": {
"kind": "sqlite",
"impl": "@cap-js/sqlite",
"credentials": {
"url": "../db.sqlite"
}
}
}
"db": { "kind": "sql" }
}
}
}