Skip to content

Commit d39b5c0

Browse files
Release 2025-06-23 (#1928)
2 parents 353fd14 + 50e4937 commit d39b5c0

20 files changed

Lines changed: 2216 additions & 318 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env node
2+
3+
import AdmZip from 'adm-zip'
4+
import { join } from 'path'
5+
import { readFile, writeFile } from 'node:fs/promises'
6+
7+
const props = await fetchProperties()
8+
await writeFile(join(import.meta.dirname, '../../java/developing-applications/properties.json'), JSON.stringify(props, null, 2))
9+
10+
console.error(`wrote ${props.length} properties to`, join(import.meta.dirname, '../../java/developing-applications/properties.json'))
11+
12+
async function fetchProperties() {
13+
const config = (await readFile(join(import.meta.dirname, '../../.vitepress/config.js'))).toString()
14+
const version = config.match(/java_services\s*:\s*['"]([^'"]+)['"]/)[1]
15+
16+
const maven = process.env.MAVEN_HOST ?? 'https://repo1.maven.org/maven2'
17+
const url = maven + `/com/sap/cds/cds-services-api/${version}/cds-services-api-${version}-sources.jar`
18+
19+
console.error(`fetching properties from`, url)
20+
const headers = process.env.MAVEN_TOKEN ? { Authorization: `Bearer ${process.env.MAVEN_TOKEN}` } : {}
21+
const resp = await fetch(url, { headers })
22+
const jar = await resp.arrayBuffer()
23+
24+
return new Promise((res, rej) => {
25+
try {
26+
const zip = new AdmZip(Buffer.from(jar))
27+
zip.readAsTextAsync('properties.json', (data, err) => {
28+
if (err) return rej(err)
29+
res(JSON.parse(data))
30+
})
31+
} catch (err) {
32+
return rej(new Error(`Could not load ${url}, response: ${Buffer.from(jar)}`, {cause: err}))
33+
// return res([])
34+
}
35+
})
36+
}

.github/workflows/PR-SAP.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ jobs:
4545
env:
4646
NODE_OPTIONS: "--max-old-space-size=6144"
4747
VITE_CAPIRE_CI_HOST: "github.com"
48+
VITE_CAPIRE_EXTRA_ASSETS: true
49+
MAVEN_HOST: https://common.repositories.cloud.sap/artifactory/build.releases
50+
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
4851
- name: Find broken anchor links
4952
working-directory: docs
5053
run: |

.github/workflows/extract-docs.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ jobs:
4141
GH_BASE: /
4242
SITE_HOSTNAME: https://cap.js.org
4343
VITE_CAPIRE_PREVIEW: true
44+
VITE_CAPIRE_EXTRA_ASSETS: true
45+
MAVEN_HOST: https://common.repositories.cloud.sap/artifactory/build.releases
46+
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
4447
- name: Upload artifact
4548
uses: actions/upload-pages-artifact@v3
4649
with:
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Update Content
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
# Runs every Wednesday at 02:45 AM (UTC)
7+
- cron: '45 2 * * 3'
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
update-cli-texts:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '22'
25+
26+
- name: Extract CLI texts
27+
run: |
28+
npm i -g @sap/cds-dk
29+
.github/cli/grab-cli-texts.sh
30+
31+
- name: Check for changes
32+
run: |
33+
git config --global user.name 'github-actions[bot]'
34+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
35+
if git diff --exit-code; then
36+
echo "No changes detected. Exiting."
37+
exit 0
38+
fi
39+
40+
- name: Create Pull Request
41+
uses: peter-evans/create-pull-request@v7
42+
with:
43+
token: ${{ secrets.GITHUB_TOKEN }}
44+
branch: "update-cds-cli-texts"
45+
commit-message: "Update CLI texts"
46+
title: "chore: Update CLI texts"
47+
body: "Updates the output of cds CLI texts to the latest version."
48+
49+
update-java-properties:
50+
runs-on: ubuntu-latest
51+
52+
steps:
53+
- name: Checkout repository
54+
uses: actions/checkout@v4
55+
56+
- name: Set up Node.js
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: '22'
60+
61+
- name: Update Java Properties
62+
run: |
63+
npm ci
64+
.github/java-properties/update-properties.js
65+
env:
66+
MAVEN_HOST: https://common.repositories.cloud.sap/artifactory/build.releases
67+
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
68+
69+
- name: Check for changes
70+
run: |
71+
git config --global user.name 'github-actions[bot]'
72+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
73+
if git diff --exit-code; then
74+
echo "No changes detected. Exiting."
75+
exit 0
76+
fi
77+
78+
- name: Create Pull Request
79+
uses: peter-evans/create-pull-request@v7
80+
with:
81+
token: ${{ secrets.GITHUB_TOKEN }}
82+
branch: "update-java-properties"
83+
commit-message: "Update Java Properties"
84+
title: "chore: Update Java Properties"
85+
body: "Updates Java properties to the latest version."

.vitepress/config.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ config.themeConfig.capire = {
109109
java_services: '4.0.2',
110110
java_cds4j: '4.0.2'
111111
},
112-
gotoLinks: [],
113-
maven_host_base: 'https://repo1.maven.org/maven2'
112+
gotoLinks: []
114113
}
115114

116115
// Add meta tag to prevent indexing of preview deployments
@@ -203,12 +202,15 @@ config.buildEnd = async ({ outDir, site }) => {
203202
sitemapURL.pathname = path.join(sitemapURL.pathname, 'sitemap.xml')
204203
await fs.writeFile(path.resolve(outDir, 'robots.txt'), `Sitemap: ${sitemapURL}\n`)
205204

206-
// zip assets aren't copied automatically, and `vite.assetInclude` doesn't work either
207-
const hanaAssetDir = 'advanced/assets'
208-
const hanaAsset = path.join(hanaAssetDir, 'native-hana-samples.zip')
209-
await fs.mkdir(path.join(outDir, hanaAssetDir), {recursive: true})
210-
console.debug('✓ copying HANA assets to ', path.join(outDir, hanaAsset)) // eslint-disable-line no-console
211-
await fs.copyFile(path.join(__dirname, '..', hanaAsset), path.join(outDir, hanaAsset))
205+
// disabled by default to avoid online fetches during local build
206+
if (process.env.VITE_CAPIRE_EXTRA_ASSETS) {
207+
// zip assets aren't copied automatically, and `vite.assetInclude` doesn't work either
208+
const hanaAssetDir = 'advanced/assets'
209+
const hanaAsset = path.join(hanaAssetDir, 'native-hana-samples.zip')
210+
await fs.mkdir(path.join(outDir, hanaAssetDir), {recursive: true})
211+
console.debug('✓ copying HANA assets to ', path.join(outDir, hanaAsset)) // eslint-disable-line no-console
212212

213-
await cdsMavenSite.copySiteAssets(path.join(outDir, 'java/assets/cds-maven-plugin-site'), site)
213+
await fs.copyFile(path.join(__dirname, '..', hanaAsset), path.join(outDir, hanaAsset))
214+
await cdsMavenSite.copySiteAssets(path.join(outDir, 'java/assets/cds-maven-plugin-site'), site)
215+
}
214216
}

.vitepress/lib/cds-maven-site.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import AdmZip from 'adm-zip'
44
export async function copySiteAssets(outDir:string, site:SiteData) {
55
const { themeConfig: { capire }} = site
66
const version = capire.versions.java_services
7-
const url = capire.maven_host_base + `/com/sap/cds/cds-maven-plugin/${version}/cds-maven-plugin-${version}-site.jar`
7+
const maven = process.env.MAVEN_HOST ?? 'https://repo1.maven.org/maven2'
8+
const url = maven + `/com/sap/cds/cds-maven-plugin/${version}/cds-maven-plugin-${version}-site.jar`
9+
const headers = process.env.MAVEN_TOKEN ? { Authorization: `Bearer ${process.env.MAVEN_TOKEN}` } : {} as Record<string, string>
810

9-
const resp = await fetch(url)
11+
console.debug(`✓ fetching CDS Maven Site from ${url}`)
12+
const resp = await fetch(url, { headers })
1013
const jar = await resp.arrayBuffer()
11-
12-
console.debug(`✓ fetching CDS Maven Site ${version}`)
1314
const zip = new AdmZip(Buffer.from(jar))
1415
zip.extractAllTo(outDir, true, false)
15-
1616
}
17-

about/best-practices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ Handling synchronous requests vs asynchronous event messages:
368368
```js [Handling sync Requests]
369369
class CatalogService { async init() {
370370
this.on ('SubmitOrder', req => { // sync action request
371-
const { book, quantity } = msg.data // process it...
371+
const { book, quantity } = req.data // process it...
372372
})
373373
}}
374374
```

get-started/learning-sources.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ It's available in both Node.js and Java. The Node.js variant contains additional
108108

109109
### Incidents Mgmt {.github}
110110

111+
> [![]()](https://github.com/cap-java/incidents-app){.java}
111112
> [![]()](https://github.com/cap-js/incidents-app){.node}
112113
113114
A reference sample application for CAP and the SAP BTP Developer Guide.
@@ -186,6 +187,7 @@ Based on this sample application, you find the bill of materials and a sizing ex
186187

187188
## Videos
188189

190+
- [The Art and Science of CAP](https://www.youtube.com/playlist?list=PL6RpkC85SLQAe45xlhIfhTYB9G0mdRVjI) <br> by DJ Adams and Daniel Hutzel
189191
- [Back to basics: CAP Node.js](https://www.youtube.com/playlist?list=PL6RpkC85SLQBHPdfHQ0Ry2TMdsT-muECx) <br> by DJ Adams
190192
- [Hybrid Testing and Alternative DBs](https://youtu.be/vqub4vJbZX8?si=j5ZkPR6vPb59iBBy) <br> by Thomas Jung
191193
- [Consume External Services](https://youtu.be/rWQFbXFEr1M) <br> by Thomas Jung

guides/databases.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,13 @@ CSV files can be found in the folders _db/data_ and _test/data_, as well as in a
249249
::: details Adding initial data next to your data model
250250
The content of these 'co-located' `.cds` files actually doesn't matter, but they need to be included in your data model, through a `using` clause in another file for example.
251251
252-
If you need to use certain CSV files exclusively for your production deployments, but not for tests, you can achieve this by including them in a separate data folder, for example, _db/hana/data_. Create an _index.cds_ file in the _hana_ folder as outlined earlier. Then, set up this model location in a dummy cds service, for example _hanaDataSrv_, using the `[production]` profile.
252+
If you need to use certain CSV files exclusively for your production deployments, but not for tests, you can achieve this by including them in a separate data folder, for example, _db/hana/data_. Create an empty _index.cds_ file in the _hana_ folder. Then, set up this model location in a dummy cds service, for example _hanaDataSrv_, using the `[production]` profile.
253253
254254
```json
255255
"cds": {
256256
"requires": {
257257
"[production]": {
258-
"hanaDataSrv ": { "model": "hana" }
258+
"hanaDataSrv ": { "model": "db/hana" }
259259
}
260260
}
261261
}

0 commit comments

Comments
 (0)