-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Sample CAP transpilation #273
Changes from all commits
769de60
89c24f4
0c1c45d
ee84ee5
9365382
36ae176
c3bdb42
3c5ee9a
0a7207d
e3b02ef
faa77e9
79d334c
844e464
71af75d
f0ab6ff
5eb7afe
34e413d
20233ad
34868cb
e154103
9caf8b1
47748b0
55141fd
23f9006
e8a2a1b
aba9904
d226f96
db7e2a9
9dfb9b2
e8024c0
5866d68
71b412c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"build": { | ||
"target": "dist" | ||
} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
applications: | ||
- name: ai-sdk-js-sample-cap | ||
path: ./dist/srv | ||
memory: 256M | ||
buildpacks: | ||
- nodejs_buildpack | ||
services: | ||
- default_aicore | ||
- default_xsuaa | ||
routes: | ||
- route: 'ai-sdk-js-sample-cap.cfapps.eu12-001.hana.ondemand.com' |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,16 +6,34 @@ | |
"repository": "https://github.com/sap/ai-sdk-js", | ||
"private": true, | ||
"dependencies": { | ||
"@sap-ai-sdk/ai-api": "workspace:^", | ||
"@sap-ai-sdk/foundation-models": "workspace:^", | ||
"@sap-ai-sdk/orchestration": "workspace:^", | ||
"@sap/cds": "^8", | ||
"express": "^4" | ||
"@sap-ai-sdk/ai-api": "^1", | ||
"@sap-ai-sdk/foundation-models": "^1", | ||
"@sap-ai-sdk/orchestration": "^1", | ||
"express": "^4", | ||
"@sap/xssec": "^4", | ||
"@sap/cds": "^8.4.1" | ||
}, | ||
"devDependencies": { | ||
"@sap/cds-dk": "^8.4.1" | ||
}, | ||
"scripts": { | ||
"prebuild": "rm -rf dist", | ||
"build": "pnpm cds-build && pnpm compile && pnpm cleanup", | ||
"cds-build": "cds build --production", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fyi, |
||
"compile": "tsc", | ||
"cleanup": "rm -f ./dist/srv/srv/**/*.ts ./dist/srv/package-lock.json", | ||
"postbuild": "pushd ./dist/srv && npm i --package-lock-only && popd", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have to remove the generated (copied) lock file and regenerate it in |
||
"start": "npx cds-serve", | ||
"watch": "cds-tsx watch", | ||
"watch:hybrid": "cds-tsx watch --profile hybrid", | ||
"lint": "eslint . && prettier . --config ../.prettierrc --ignore-path ../.prettierignore -c", | ||
"lint:fix": "eslint . --fix && prettier . --config ../.prettierrc --ignore-path ../.prettierignore -w --log-level error" | ||
}, | ||
"cds": { | ||
"requires": { | ||
"[production]": { | ||
"auth": "xsuaa" | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
@path: 'ai-api' | ||
@requires: 'any' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fyi, nodejs CAP by default authenticate all endpoints. Ideally, setting up an app-router to do authentication would be the right approach. For testing purpose, I just expose them all publicly. STOP THE APPLICATION after testing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would document this in the readme, as this is related to security topics. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
service AiApiService { | ||
action getDeployments() returns String; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"rootDir": "./srv", | ||
"outDir": "./dist/srv/srv", | ||
"tsBuildInfoFile": "./dist/.tsbuildinfo", | ||
"composite": true | ||
}, | ||
"include": ["srv/**/*.ts"], | ||
"exclude": ["dist/**/*", "**/*.test.ts", "node_modules/**/*"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"scopes": [], | ||
"attributes": [], | ||
"role-templates": [] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,4 +134,6 @@ Istio | |
[Mm]egaclite | ||
|
||
seldomly | ||
lookups | ||
lookups | ||
|
||
CDS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fyi, I removed deps check for this sample cap package because, e.g., xssec was added when using
cds add xsuaa
but our check complains that this package is not used. And also for dev deps@cap-js/cds-types
.