@sap/cds-dk 9.8.4 → 9.9.1

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.
Files changed (84) hide show
  1. package/CHANGELOG.md +32 -2
  2. package/bin/add.js +3 -3
  3. package/bin/cds.js +28 -5
  4. package/bin/debug.js +4 -3
  5. package/bin/import.js +6 -2
  6. package/bin/logout.js +9 -12
  7. package/lib/bind/shared.js +2 -2
  8. package/lib/build/constants.js +0 -1
  9. package/lib/build/index.js +420 -463
  10. package/lib/build/plugins/hana/index.js +121 -2
  11. package/lib/build/plugins/helm/files/subcharts/content-deployment/Chart.yaml +1 -1
  12. package/lib/build/plugins/helm/files/subcharts/content-deployment/templates/job.yaml +1 -1
  13. package/lib/build/plugins/helm/files/subcharts/content-deployment/values.schema.json +4 -0
  14. package/lib/build/plugins/helm/files/subcharts/content-deployment/values.yaml +5 -2
  15. package/lib/build/plugins/internal.js +1 -1
  16. package/lib/build/plugins/mtx-extension/index.js +0 -2
  17. package/lib/deploy/index.js +23 -3
  18. package/lib/deploy/to-hana/hana.js +24 -15
  19. package/lib/import/common.js +6 -3
  20. package/lib/init/constants.js +3 -1
  21. package/lib/init/indent.js +0 -1
  22. package/lib/init/merge.js +0 -1
  23. package/lib/init/mvn.js +4 -2
  24. package/lib/init/projectReader.js +0 -1
  25. package/lib/init/registries/mta.js +4 -2
  26. package/lib/init/template/app-frontend/files/ui5.yaml.hbs +1 -1
  27. package/lib/init/template/app-frontend/index.js +39 -4
  28. package/lib/init/template/data/as-csv.js +2 -0
  29. package/lib/init/template/enterprise-messaging/index.js +1 -1
  30. package/lib/init/template/enterprise-messaging-shared/index.js +1 -1
  31. package/lib/init/template/esm/index.js +5 -0
  32. package/lib/init/template/extensibility/index.js +1 -1
  33. package/lib/init/template/hana/index.js +1 -1
  34. package/lib/init/template/html5-repo/files/mta.yaml.hbs +9 -20
  35. package/lib/init/template/html5-repo/files/ui5.yaml.hbs +1 -1
  36. package/lib/init/template/http/index.js +34 -6
  37. package/lib/init/template/kyma/index.js +1 -0
  38. package/lib/init/template/lint/files/package.json +1 -1
  39. package/lib/init/template/nodejs/files/package.json.hbs +1 -1
  40. package/lib/init/template/pipeline/files/ui5.yaml.hbs +1 -1
  41. package/lib/init/template/postgres/files/values.yaml.hbs +1 -1
  42. package/lib/init/template/postgres/index.js +1 -1
  43. package/lib/init/template/react/files/index.html +13 -0
  44. package/lib/init/template/react/files/package.json.hbs +22 -0
  45. package/lib/init/template/react/files/public/favicon.svg +1 -0
  46. package/lib/init/template/react/files/src/App.jsx.hbs +29 -0
  47. package/lib/init/template/react/files/src/index.css +28 -0
  48. package/lib/init/template/react/files/src/main.jsx +10 -0
  49. package/lib/init/template/react/files/vite.config.js +19 -0
  50. package/lib/init/template/react/index.js +29 -0
  51. package/lib/init/template/sample/index.js +1 -4
  52. package/lib/init/template/test/files/package.json +1 -1
  53. package/lib/init/template/test/files/test/test.xs.hbs +3 -3
  54. package/lib/init/template/typer/index.js +1 -1
  55. package/lib/init/template/typescript/files/package.json +1 -1
  56. package/lib/init/template/typescript/index.js +1 -1
  57. package/lib/init/template/ui5/index.js +2 -1
  58. package/lib/init/template/vue/files/index.html +13 -0
  59. package/lib/init/template/vue/files/package.json.hbs +19 -0
  60. package/lib/init/template/vue/files/public/favicon.svg +1 -0
  61. package/lib/init/template/vue/files/src/App.vue.hbs +34 -0
  62. package/lib/init/template/vue/files/src/main.js +5 -0
  63. package/lib/init/template/vue/files/src/style.css +20 -0
  64. package/lib/init/template/vue/files/vite.config.js +19 -0
  65. package/lib/init/template/vue/index.js +30 -0
  66. package/lib/init/template/workzone-standard/files/mta.yaml.hbs +2 -13
  67. package/lib/init/xml.js +0 -2
  68. package/lib/mtx/auth_manager.js +21 -11
  69. package/lib/mtx/download_legacy.js +9 -8
  70. package/lib/mtx/pull.js +9 -8
  71. package/lib/mtx/push.js +42 -28
  72. package/lib/mtx/settings_manager.js +17 -10
  73. package/lib/mtx/tenant_action.js +9 -9
  74. package/lib/mtx/util/request.js +158 -0
  75. package/lib/util/cf.js +30 -29
  76. package/lib/watch/node-watch.js +1 -1
  77. package/lib/watch/vite-watch.js +76 -0
  78. package/lib/watch/watched.js +5 -4
  79. package/npm-shrinkwrap.json +25 -165
  80. package/package.json +3 -4
  81. package/lib/init/template/sample/files/db/hana/index.cds +0 -10
  82. package/lib/init/template/sample/files/db/sqlite/index.cds +0 -10
  83. package/lib/init/template/sample/files/package.json.hbs +0 -14
  84. package/lib/util/axios.js +0 -118
package/CHANGELOG.md CHANGED
@@ -6,11 +6,41 @@ 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.8.4 - 2026-04-10
9
+ ## Version 9.9.1 - 2026-05-07
10
+
11
+ ### Changed
12
+
13
+ - `cds add lint` now adds a dependency on `eslint@10`, instead of `eslint@9`.
14
+
15
+ ### Fixed
16
+
17
+ - `cds add test` now uses version 1 of `@cap-js/cds-test`.
18
+ - `cds add vue` uses correct placeholder values for book and author in `App.vue`.
19
+ - `cds debug` support for latest Chrome versions.
20
+ - `cds watch` runs ESM projects with `tsx` again, so that `.js` import are rewritten to `.ts`. This got broken in 9.9.0, but used to work in 9.8.
21
+ - `cds add` only adds the `event-mesh.json` if a facet requiring the file is run.
22
+
23
+ ## Version 9.9.0 - 2026-04-23
24
+
25
+ ### Added
26
+
27
+ - `cds build` routes `.hdbsynonymconfig` files with `*.configure` properties to the `cfg/` folder for HDI template substitution.
28
+ - `cds deploy` also supports `-b` as a shortcut for `--resolve-bindings`.
29
+ - `cds import` now supports `--resolve-bindings`.
30
+
31
+ ### Changed
32
+
33
+ - `cds add html5-repo` creates destinations as part of the app deployer module instead of initial destinations in the destination service.
34
+ - `axios` is removed from `dependencies`.
35
+ - `cds init` no longer generates database-specific extensions (`db/hana/`, `db/sqlite/`) and their profile-based configuration in the sample template.
10
36
 
11
37
  ### Fixed
12
38
 
13
- - `axios` bump to 1.15.0 for CVE-2025-62718.
39
+ - `cds add xsuaa --plan broker` does not use plan `application` in approuter scenarios.
40
+ - `cds add postgres` for Kyma no longer adds an invalid `values.yaml` entry for `postgres-db-deployer`.
41
+ - `cds init/add esm` now also fills `package.json` with proper content.
42
+ - `cds deploy --to hana --resolve-bindings` no longer overwrites credentials of all hana-tagged `VCAP_SERVICES` entries with the target container's service key when multiple HDI bindings are present.
43
+ - `cds add data` now adds a newline character at the end of csv files to make appending content easier.
14
44
 
15
45
  ## Version 9.8.3 - 2026-04-02
16
46
 
package/bin/add.js CHANGED
@@ -36,7 +36,7 @@ module.exports = Object.assign(add, {
36
36
 
37
37
  Pick any of these:
38
38
 
39
- ${cds.cli.command !== 'completion' && require('../lib/init').help({ exclude: ['java', 'nodejs'] })}
39
+ ${cds.cli.command !== 'completion' && require('../lib/init').help()}
40
40
 
41
41
  # OPTIONS
42
42
 
@@ -55,8 +55,8 @@ ${cds.cli.command !== 'completion' && require('../lib/init').help({ exclude: ['j
55
55
 
56
56
  # FEATURE OPTIONS
57
57
 
58
- ${Object.entries(conf).sort(([a], [b]) => a.localeCompare(b)).flatMap(([pluginName, { options, flags }]) => {
59
- const text4 = arr => arr.map(({ key, help, short }) => help && ` ${key}${short ? ' | '+short : ''}\n\n ${help}`).join('\n\n')
58
+ ${Object.entries(conf).flatMap(([pluginName, { options, flags }]) => {
59
+ const text4 = arr => arr.map(({ key, help, short }) => help && ` ${key}${short ? ' | '+short : ''}\n\n ${help}`).filter(Boolean).join('\n\n')
60
60
  const optionsText = text4(options), flagsText = text4(flags)
61
61
  if (!optionsText && !flagsText) return []
62
62
  return ` *cds add ${pluginName}*${optionsText?`\n\n${optionsText}`:''}${flagsText?`\n\n${flagsText}`:''}`
package/bin/cds.js CHANGED
@@ -89,6 +89,19 @@ const cli = {
89
89
  args[0].push(...appendArgs)
90
90
  cds.cli = { command: cmd, argv: args[0], options: args[1] }
91
91
 
92
+ // For import: load plugins early to merge their default options
93
+ // so if plugins need bindings it is handled by the _resolveBindings below
94
+ if (cmd === 'import' && args[1]?.from) {
95
+ await cds.plugins
96
+ const pluginOpts = cds.import?.options?.[args[1].from]
97
+ if (pluginOpts) for (const k in pluginOpts) {
98
+ if (!(k in args[1])) args[1][k] = pluginOpts[k]
99
+ }
100
+ if (args[1].profile) {
101
+ process.env.CDS_ENV = [...new Set([...process.env.CDS_ENV?.split(',') ?? [], ...args[1].profile.split(',')])]
102
+ }
103
+ }
104
+
92
105
  if (args[1]?.['resolve-bindings']) await _resolveBindings({ silent: cmd === 'env' })
93
106
 
94
107
  _prepareTsIfNeeded(cds)
@@ -163,8 +176,9 @@ const DEBUG = /\b(y|all|cli)\b/.test(process.env.DEBUG) ? console.debug : undefi
163
176
  async function _resolveBindings(options) {
164
177
  const cds = require('../lib/cds')
165
178
  const { env: bindingEnv } = require('../lib/bind/shared')
166
- Object.assign(process.env, await bindingEnv(options))
167
- cds.env = cds.env.for('cds') // reload env
179
+ cds.env = cds.env.for('cds') // reload env (e.g. after profile activation)
180
+ Object.assign(process.env, await bindingEnv({ ...options, env: cds.env }))
181
+ cds.env = cds.env.for('cds') // reload env to pick up resolved bindings
168
182
  cds.requires = cds.env.requires
169
183
  }
170
184
 
@@ -250,9 +264,11 @@ function _prepareTsIfNeeded(cds) {
250
264
  return delete process.env.CDS_TYPESCRIPT
251
265
 
252
266
  if (!process.env.CDS_TYPESCRIPT ) {
267
+ const type = _moduleType(cds)
268
+ const tsxLoader = type === 'module' ? 'tsx/esm' : 'tsx/cjs'
253
269
  try {
254
- cds._localOrGlobal('tsx/cjs') // cjs is needed as we are in CJS code
255
- DEBUG?.(`[cds] - Detected ${path.relative(cds.root, tsconfig)}. Running with tsx.\n`)
270
+ cds._localOrGlobal(tsxLoader)
271
+ DEBUG?.(`[cds] - Detected ${path.relative(cds.root, tsconfig)}. Running with ${tsxLoader}.\n`)
256
272
  process.env.CDS_TYPESCRIPT = 'tsx'
257
273
  }
258
274
  catch (e) {
@@ -262,5 +278,12 @@ function _prepareTsIfNeeded(cds) {
262
278
  }
263
279
  }
264
280
  }
265
-
266
281
  }
282
+
283
+ function _moduleType(cds) {
284
+ try {
285
+ return require(path.join(cds.root??'.', 'package.json')).type
286
+ } catch {
287
+ return 'commonjs'
288
+ }
289
+ }
package/bin/debug.js CHANGED
@@ -215,15 +215,16 @@ async function debug() {
215
215
  async function openDevTools(port) {
216
216
  attempts++
217
217
  const ide = vscode ? 'vscode' : 'chrome'
218
+ const clientHost = host === '0.0.0.0' || host === 'localhost' ? '127.0.0.1' : host
218
219
  try {
219
220
  switch (ide) {
220
221
  case 'chrome': {
221
- const res = await fetch(`http://localhost:${port}/json/list`)
222
+ const res = await fetch(`http://${clientHost}:${port}/json/list`)
222
223
  const data = await res.json()
223
224
  if (!data?.length) throw 'No debugger found on port ' + port
224
- const wsUrl = data[0].webSocketDebuggerUrl
225
+ const wsPath = new URL(data[0].webSocketDebuggerUrl).pathname
225
226
  let command
226
- const url = `devtools://devtools/bundled/inspector.html?ws=${wsUrl.split('ws://')[1]}`
227
+ const url = `devtools://devtools/bundled/js_app.html?ws=${clientHost}:${port}${wsPath}`
227
228
  console.log(`Opening Chrome DevTools at ${url}`)
228
229
  if (os === 'darwin') {
229
230
  command = `open -a "Google Chrome" '${url}'`
package/bin/import.js CHANGED
@@ -1,8 +1,8 @@
1
1
  module.exports = Object.assign(_import, {
2
2
  _name: 'import',
3
3
  options: [ '--services', '--for', '--out', '--as', '--name', '--include-namespaces', '--dependencies', '--from', '--config', '--destination', '--group', '--into-namespace' ],
4
- shortcuts: [ '-s', '-4', '-o', '-as', '-n', '-ns', '-d',undefined, '-c', undefined, undefined, '-2', '-', '-f'],
5
- flags: [ '--dry', '--force', '--no-copy', '--no-save', '--keep-namespace', '--data-product', '--edmx', '--rfc', '--odata', '--openapi', '--asyncapi' ],
4
+ shortcuts: [ '-s', '-4', '-o', '-as', '-n', '-ns', '-d',undefined, '-c', undefined, undefined, '-2', '-', '-f', '-b'],
5
+ flags: [ '--dry', '--force', '--resolve-bindings', '--no-copy', '--no-save', '--keep-namespace', '--data-product', '--edmx', '--rfc', '--odata', '--openapi', '--asyncapi' ],
6
6
  help: `
7
7
  # SYNOPSIS
8
8
 
@@ -33,6 +33,10 @@ module.exports = Object.assign(_import, {
33
33
  (Not released with general availability yet)
34
34
 
35
35
 
36
+ *-b | --resolve-bindings*
37
+
38
+ Resolve remote service bindings configured via *cds bind*.
39
+
36
40
  *--dry*
37
41
  Writes the converted csn to stdout only.
38
42
 
package/bin/logout.js CHANGED
@@ -12,14 +12,14 @@ module.exports = Object.assign(logout, {
12
12
  *cds pull* and *cds push*. In default mode, deletes only data for a
13
13
  specific app URL and subdomain, optionally including relevant project
14
14
  settings.
15
-
15
+
16
16
  <app-url> and <tenant-subdomain> will be determined from project settings
17
17
  unless given by options.
18
-
18
+
19
19
  Project settings will be loaded by reference to the given folder.
20
20
  If omitted, the project setting are loaded from a subdirectory named as the
21
21
  subdomain or the current working directory.
22
-
22
+
23
23
  To access keyring storage, the 'keytar' Node.js module must be installed.
24
24
  If this is not the case, existing keyring entries will not be detected and
25
25
  cannot be removed by this command.
@@ -28,25 +28,25 @@ module.exports = Object.assign(logout, {
28
28
  # OPTIONS
29
29
 
30
30
  *-l* | *--url* <app-url>
31
-
31
+
32
32
  The <app-url> to logout from. By default, it's determined from project
33
33
  settings.
34
-
34
+
35
35
  *-s* | *--subdomain* <subdomain>
36
-
36
+
37
37
  The subdomain to logout from. By default, it's determined from project
38
38
  settings.
39
39
 
40
40
  *--delete-settings*
41
-
41
+
42
42
  Additionally removes the settings for the given extension project.
43
43
 
44
44
  *--clear-invalid*
45
-
45
+
46
46
  Enter special mode to clear all tokens and settings for any project
47
47
  folders which no longer exist in the file system. Additionally, removes
48
48
  expired tokens. Ignores any other command-line arguments.
49
-
49
+
50
50
  `;
51
51
  }})
52
52
 
@@ -56,6 +56,3 @@ async function logout ([projectFolder], options = {}) {
56
56
 
57
57
  await require('../lib/mtx/auth_manager').logout(options)
58
58
  }
59
-
60
-
61
- /* eslint no-console: off */
@@ -12,8 +12,8 @@ const KindToRequiresNameMap = {
12
12
  'ias-auth': 'auth',
13
13
  'hana-cloud': 'db',
14
14
  hana: 'db',
15
- 'hana-mt': 'db', // For compatibility only
16
- 'sql-mt': 'db', // For compatibility only
15
+ 'hana-mt': 'db', // cds10: remove, For compatibility only
16
+ 'sql-mt': 'db', // cds10: remove, For compatibility only
17
17
  destinations: 'destinations',
18
18
  connectivity: 'connectivity',
19
19
  'audit-log': 'auditlog',
@@ -40,7 +40,6 @@ exports.FOLDER_GEN = "gen"
40
40
  exports.FILE_EXT_CDS = ".cds"
41
41
  exports.MTX_SIDECAR_FOLDER = "mtx/sidecar" // default name of the mtx sidecar folder
42
42
  exports.DEFAULT_CSN_FILE_NAME = "csn.json"
43
- // REVISIT: the models are not required if a custom server.js file is used for MTX bootstrap
44
43
  exports.NODEJS_MODEL_EXCLUDE_LIST = ['@sap/cds-mtxs/srv/bootstrap']
45
44
 
46
45
  exports.CDS_CONFIG_PATH_SEP = "/"