@sap/cds-dk 9.8.3 → 9.9.0

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 (74) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/bin/add.js +3 -3
  3. package/bin/cds.js +16 -2
  4. package/bin/import.js +6 -2
  5. package/bin/logout.js +9 -12
  6. package/lib/bind/shared.js +2 -2
  7. package/lib/build/constants.js +0 -1
  8. package/lib/build/index.js +420 -463
  9. package/lib/build/plugins/hana/index.js +121 -2
  10. package/lib/build/plugins/helm/files/subcharts/content-deployment/Chart.yaml +1 -1
  11. package/lib/build/plugins/helm/files/subcharts/content-deployment/templates/job.yaml +1 -1
  12. package/lib/build/plugins/helm/files/subcharts/content-deployment/values.schema.json +4 -0
  13. package/lib/build/plugins/helm/files/subcharts/content-deployment/values.yaml +5 -2
  14. package/lib/build/plugins/internal.js +1 -1
  15. package/lib/build/plugins/mtx-extension/index.js +0 -2
  16. package/lib/deploy/index.js +23 -3
  17. package/lib/deploy/to-hana/hana.js +24 -15
  18. package/lib/import/common.js +6 -3
  19. package/lib/init/constants.js +3 -1
  20. package/lib/init/indent.js +0 -1
  21. package/lib/init/merge.js +0 -1
  22. package/lib/init/mvn.js +4 -2
  23. package/lib/init/projectReader.js +0 -1
  24. package/lib/init/registries/mta.js +4 -2
  25. package/lib/init/template/app-frontend/index.js +39 -4
  26. package/lib/init/template/data/as-csv.js +2 -0
  27. package/lib/init/template/esm/index.js +5 -0
  28. package/lib/init/template/extensibility/index.js +1 -1
  29. package/lib/init/template/hana/index.js +1 -1
  30. package/lib/init/template/html5-repo/files/mta.yaml.hbs +9 -20
  31. package/lib/init/template/http/index.js +34 -6
  32. package/lib/init/template/kyma/index.js +1 -0
  33. package/lib/init/template/postgres/files/values.yaml.hbs +1 -1
  34. package/lib/init/template/postgres/index.js +1 -1
  35. package/lib/init/template/react/files/index.html +13 -0
  36. package/lib/init/template/react/files/package.json.hbs +22 -0
  37. package/lib/init/template/react/files/public/favicon.svg +1 -0
  38. package/lib/init/template/react/files/src/App.jsx.hbs +29 -0
  39. package/lib/init/template/react/files/src/index.css +28 -0
  40. package/lib/init/template/react/files/src/main.jsx +10 -0
  41. package/lib/init/template/react/files/vite.config.js +19 -0
  42. package/lib/init/template/react/index.js +29 -0
  43. package/lib/init/template/sample/index.js +1 -4
  44. package/lib/init/template/typer/index.js +1 -1
  45. package/lib/init/template/typescript/files/package.json +1 -1
  46. package/lib/init/template/typescript/index.js +1 -1
  47. package/lib/init/template/ui5/index.js +2 -1
  48. package/lib/init/template/vue/files/index.html +13 -0
  49. package/lib/init/template/vue/files/package.json.hbs +19 -0
  50. package/lib/init/template/vue/files/public/favicon.svg +1 -0
  51. package/lib/init/template/vue/files/src/App.vue.hbs +34 -0
  52. package/lib/init/template/vue/files/src/main.js +5 -0
  53. package/lib/init/template/vue/files/src/style.css +20 -0
  54. package/lib/init/template/vue/files/vite.config.js +19 -0
  55. package/lib/init/template/vue/index.js +29 -0
  56. package/lib/init/template/workzone-standard/files/mta.yaml.hbs +2 -13
  57. package/lib/init/xml.js +0 -2
  58. package/lib/mtx/auth_manager.js +21 -11
  59. package/lib/mtx/download_legacy.js +9 -8
  60. package/lib/mtx/pull.js +9 -8
  61. package/lib/mtx/push.js +42 -28
  62. package/lib/mtx/settings_manager.js +17 -10
  63. package/lib/mtx/tenant_action.js +9 -9
  64. package/lib/mtx/util/request.js +158 -0
  65. package/lib/util/cf.js +30 -29
  66. package/lib/watch/node-watch.js +1 -1
  67. package/lib/watch/vite-watch.js +76 -0
  68. package/lib/watch/watched.js +5 -4
  69. package/npm-shrinkwrap.json +25 -165
  70. package/package.json +1 -2
  71. package/lib/init/template/sample/files/db/hana/index.cds +0 -10
  72. package/lib/init/template/sample/files/db/sqlite/index.cds +0 -10
  73. package/lib/init/template/sample/files/package.json.hbs +0 -14
  74. package/lib/util/axios.js +0 -118
package/CHANGELOG.md CHANGED
@@ -6,6 +6,28 @@ 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.9.0 - 2026-04-23
10
+
11
+ ### Added
12
+
13
+ - `cds build` routes `.hdbsynonymconfig` files with `*.configure` properties to the `cfg/` folder for HDI template substitution.
14
+ - `cds deploy` also supports `-b` as a shortcut for `--resolve-bindings`.
15
+ - `cds import` now supports `--resolve-bindings`.
16
+
17
+ ### Changed
18
+
19
+ - `cds add html5-repo` creates destinations as part of the app deployer module instead of initial destinations in the destination service.
20
+ - `axios` is removed from `dependencies`.
21
+ - `cds init` no longer generates database-specific extensions (`db/hana/`, `db/sqlite/`) and their profile-based configuration in the sample template.
22
+
23
+ ### Fixed
24
+
25
+ - `cds add xsuaa --plan broker` does not use plan `application` in approuter scenarios.
26
+ - `cds add postgres` for Kyma no longer adds an invalid `values.yaml` entry for `postgres-db-deployer`.
27
+ - `cds init/add esm` now also fills `package.json` with proper content.
28
+ - `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.
29
+ - `cds add data` now adds a newline character at the end of csv files to make appending content easier.
30
+
9
31
  ## Version 9.8.3 - 2026-04-02
10
32
 
11
33
  ### Fixed
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
 
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 = "/"