@sap/cds-dk 9.7.1 → 9.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,16 @@ This project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
7
  The format is based on [Keep a Changelog](https://keepachangelog.com/).
8
8
 
9
+ ## Version 9.7.2 - tbd
10
+
11
+ ### Fixed
12
+
13
+ - `cds build --for mtx-sidecar` correctly resolves `@source` in custom MTX sidecar services.
14
+ - `cds build` now utilises caching for workspace resolution, which will speed up build times for projects with many workspaces.
15
+ - `cds add` commands don't augment Helm Charts if not managed by CAP.
16
+ - `cds add approuter` for Kyma configures token exchange for managed approuter scenarios.
17
+ - `cds bind` reports additional error information while accessing Cloud Foundry services.
18
+
9
19
  ## Version 9.7.1 - 2026-02-05
10
20
 
11
21
  ### Fixed
@@ -148,7 +148,7 @@ module.exports = class extends require('../nodejs') {
148
148
  // existing compilation error messages that have been downgraded to warnings
149
149
  // see cap/issues/issues/16401#issuecomment-7205397
150
150
  const messages = []
151
- const model = cds.load(modelFilePaths, { sync: true, messages })
151
+ const model = cds.load(modelFilePaths, { sync: true, messages, cwd: this.task.src })
152
152
  messages.forEach(msg => this.messages.push(msg))
153
153
  return model
154
154
  }
package/lib/build/util.js CHANGED
@@ -326,33 +326,43 @@ function filterFeaturePaths(model, modelPaths) {
326
326
  return sources
327
327
  }
328
328
 
329
+ // spawning npm ls is expensive. In projects with many workspaces,
330
+ // this can significantly increase build time, despite the result being the same.
331
+ const _cachedWsRoots = new Map()
329
332
  /**
330
333
  * Read installed npm workspaces using 'npm ls -ws --json'.
331
334
  * There is currently no easier way for this, as workspaces
332
- * could contain globs. Glob resolution will be supported
335
+ * could contain globs. Glob resolution will be supported.
336
+ * The result is cached by workspace root!
333
337
  * natively in the future (fs.glob is in experimental state as of Node23).
334
338
  * @param {import('fs').PathLike} wsRoot - the root directory of the workspace
335
339
  * @returns {Promise<string[]>} list of package paths, or an empty array if either
336
340
  * no workspaces are defined or have not been installed.
337
341
  */
338
342
  async function _execNpmWs(wsRoot) {
343
+ const cached = _cachedWsRoots.get(wsRoot)
344
+ if (cached) {
345
+ return cached
346
+ }
347
+ /** @type {string[]} */
348
+ let result = []
339
349
  try {
340
350
  const cmdLine = 'npm ls -ws --json'
341
351
  DEBUG?.(`execute ${cmdLine}`)
342
352
  // @ts-expect-error - TODO: shell should be a string. But can probably be removed altogether?
343
- const result = await execAsync(cmdLine, { shell: IS_WIN, stdio: ['inherit', 'pipe', 'inherit'], cwd: wsRoot })
344
- // DEBUG?.(result.stdout)
345
- const jsonResult = JSON.parse(result.stdout)
353
+ const { stdout } = await execAsync(cmdLine, { shell: IS_WIN, stdio: ['inherit', 'pipe', 'inherit'], cwd: wsRoot })
354
+ const jsonResult = JSON.parse(stdout)
346
355
  if (jsonResult.dependencies) {
347
- return Object.keys(jsonResult.dependencies)
356
+ result = Object.keys(jsonResult.dependencies)
348
357
  } else if (jsonResult.name) {
349
- return [jsonResult.name]
358
+ result = [jsonResult.name]
350
359
  }
351
360
  } catch (/** @type {{stderr: string}} */e) {
352
- e.stderr = e.stderr?.replace(/npm ERR! /g, '')
361
+ e.stderr = e.stderr?.replace(/npm ERR! /gi, '')
353
362
  throw e
354
363
  }
355
- return []
364
+ _cachedWsRoots.set(wsRoot, result)
365
+ return result
356
366
  }
357
367
 
358
368
  function _validateWsDependencies(wsRoot, dependencies, devDependencies) {
@@ -29,6 +29,7 @@ approuter:
29
29
  backendDestinations:
30
30
  srv-api:
31
31
  service: srv
32
+ Authentication: OAuth2UserTokenExchange
32
33
  {{#hasMultitenancy}}
33
34
  mtx-api:
34
35
  service: {{#isJava}}srv{{/isJava}}{{^isJava}}sidecar{{/isJava}}
@@ -11,14 +11,12 @@ File or Folder | Purpose
11
11
  `srv/` | your service models and code go here
12
12
  `readme.md` | this getting started guide
13
13
 
14
-
15
14
  ## Next Steps
16
15
 
17
16
  - Open a new terminal and run `cds watch`
18
17
  - (in VS Code simply choose _**Terminal** > Run Task > cds watch_)
19
- - Start adding content, for example, a [db/schema.cds](db/schema.cds).
20
-
18
+ - Start with your domain model, in a CDS file in `db/`
21
19
 
22
20
  ## Learn More
23
21
 
24
- Learn more at https://cap.cloud.sap.
22
+ Learn more at <https://cap.cloud.sap>.
@@ -1,6 +1,6 @@
1
1
  const { join } = require('path')
2
2
  const cds = require('../../../cds')
3
- const { exists, rimraf, copy, yaml } = cds.utils
3
+ const { exists, rimraf, copy, yaml, fs } = cds.utils
4
4
  const { readProject } = require('../../projectReader')
5
5
  const { merge } = require('../../merge')
6
6
  const { ask4 } = require('../../../util/question')
@@ -21,7 +21,11 @@ module.exports = class KymaTemplate extends require('../../plugin') {
21
21
  }
22
22
 
23
23
  static hasInProduction() {
24
- return exists('chart/Chart.yaml')
24
+ if (exists('chart/Chart.yaml')) {
25
+ const chartYaml = yaml.parse(fs.readFileSync(join(cds.root, 'chart', 'Chart.yaml'), 'utf8'))
26
+ return chartYaml.annotations?.["app.kubernetes.io/managed-by"] === 'cds-dk/helm'
27
+ }
28
+ return false
25
29
  }
26
30
 
27
31
  async canRun() {
package/lib/util/cf.js CHANGED
@@ -101,7 +101,7 @@ module.exports = new class CfUtil {
101
101
  if (err.response?.data?.errors[0]) {
102
102
  throw JSON.stringify(err.response.data.errors[0], null, 4);
103
103
  }
104
- throw err.message;
104
+ throw `${err.name} ${err.code} ${err.status||''}: ${err.message} while accessing ${url}`;
105
105
  }
106
106
  }
107
107
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "9.7.1",
3
+ "version": "9.7.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@sap/cds-dk",
9
- "version": "9.7.1",
9
+ "version": "9.7.2",
10
10
  "license": "SEE LICENSE IN LICENSE",
11
11
  "dependencies": {
12
12
  "@cap-js/asyncapi": "^1.0.0",
@@ -89,8 +89,8 @@
89
89
  }
90
90
  },
91
91
  "node_modules/@sap/cds": {
92
- "version": "9.7.0",
93
- "integrity": "sha512-E2ntY7l98fIIbhRbgjxL/M3+iM0mAOz8ehNu+evCUusQHveTWyx3b4DQomJaD4yOAlzMq1m26iDYQBT8HuSIpg==",
92
+ "version": "9.7.1",
93
+ "integrity": "sha512-DCMCB3FiQoWVeHQulSFbZMkmuoW0z6tJRP85Xv2Bd2Cl2J2I4+LQD1GKDiUXrlJXm0CtKsFQcrsxcQmUeO5uXw==",
94
94
  "license": "SEE LICENSE IN LICENSE",
95
95
  "dependencies": {
96
96
  "@sap/cds-compiler": "^6.4",
@@ -116,8 +116,8 @@
116
116
  }
117
117
  },
118
118
  "node_modules/@sap/cds-compiler": {
119
- "version": "6.7.2",
120
- "integrity": "sha512-5UpDA7boOmwtTBWjhEDbpXKgxjqz+0zObBr12P3g5D7QIMF+hPrPG+J0Bm2AQRPE/lv8VcnzFEaMdibRgmGtUw==",
119
+ "version": "6.7.3",
120
+ "integrity": "sha512-MlKvr3b7meSD4UsMr/u5eXUS0q226MyHg/+x5xKOxxdqhh1yGGnJD0lj0USqo4S3rggFfCSgWypTAjD7VLZdUw==",
121
121
  "license": "SEE LICENSE IN LICENSE",
122
122
  "bin": {
123
123
  "cdsc": "bin/cdsc.js",
@@ -137,8 +137,8 @@
137
137
  }
138
138
  },
139
139
  "node_modules/@sap/cds-mtxs": {
140
- "version": "3.7.0",
141
- "integrity": "sha512-SojfvUrcPaVmaPpddUqosAC6Eqft+wdZMLs56C5a0XM54l3P+aWKgd4+G2IBbUjtAgeSznzmwb64dT5oOncSOQ==",
140
+ "version": "3.7.1",
141
+ "integrity": "sha512-yMsD6C4UAPozvm4TNUojAFYYC13au45hamr+S7cXT7K9ufYl7zzLGQ3Z/bE91D57z0IfryCXMsxk437P3cEJuA==",
142
142
  "license": "SEE LICENSE IN LICENSE",
143
143
  "dependencies": {
144
144
  "@sap/hdi-deploy": "^5"
@@ -251,12 +251,12 @@
251
251
  "license": "MIT"
252
252
  },
253
253
  "node_modules/axios": {
254
- "version": "1.13.4",
255
- "integrity": "sha512-1wVkUaAO6WyaYtCkcYCOx12ZgpGf9Zif+qXa4n+oYzK558YryKqiL6UWwd5DqiH3VRW0GYhTZQ/vlgJrCoNQlg==",
254
+ "version": "1.13.5",
255
+ "integrity": "sha512-cz4ur7Vb0xS4/KUN0tPWe44eqxrIu31me+fbang3ijiNscE129POzipJJA6zniq2C/Z6sJCjMimjS8Lc/GAs8Q==",
256
256
  "license": "MIT",
257
257
  "dependencies": {
258
- "follow-redirects": "^1.15.6",
259
- "form-data": "^4.0.4",
258
+ "follow-redirects": "^1.15.11",
259
+ "form-data": "^4.0.5",
260
260
  "proxy-from-env": "^1.1.0"
261
261
  }
262
262
  },
@@ -1334,8 +1334,8 @@
1334
1334
  }
1335
1335
  },
1336
1336
  "node_modules/qs": {
1337
- "version": "6.14.1",
1338
- "integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==",
1337
+ "version": "6.14.2",
1338
+ "integrity": "sha512-V/yCWTTF7VJ9hIh18Ugr2zhJMP01MY7c5kh4J870L7imm6/DIzBsNLTXzMwUA3yZ5b/KBqLx8Kp3uRvd7xSe3Q==",
1339
1339
  "license": "BSD-3-Clause",
1340
1340
  "dependencies": {
1341
1341
  "side-channel": "^1.1.0"
@@ -1447,8 +1447,8 @@
1447
1447
  }
1448
1448
  },
1449
1449
  "node_modules/semver": {
1450
- "version": "7.7.3",
1451
- "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==",
1450
+ "version": "7.7.4",
1451
+ "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",
1452
1452
  "devOptional": true,
1453
1453
  "license": "ISC",
1454
1454
  "bin": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "9.7.1",
3
+ "version": "9.7.2",
4
4
  "description": "Command line client and development toolkit for the SAP Cloud Application Programming Model",
5
5
  "homepage": "https://cap.cloud.sap/",
6
6
  "keywords": [