@sap/cds-dk 9.4.3 → 9.6.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 (168) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/bin/compile/index.js +1 -1
  3. package/bin/env.js +3 -3
  4. package/bin/export.js +1 -1
  5. package/bin/help.js +0 -1
  6. package/bin/import.js +8 -3
  7. package/bin/repl.js +7 -11
  8. package/bin/up.js +159 -23
  9. package/bin/util/containerize.js +79 -25
  10. package/bin/version.js +4 -4
  11. package/lib/bind/k8s.js +1 -1
  12. package/lib/build/plugins/helm/files/templates/_deployment_helpers.tpl +1 -1
  13. package/lib/build/plugins/helm/index.js +1 -1
  14. package/lib/build/provider/hana/2migration.js +16 -24
  15. package/lib/build/provider/hana/index.js +1 -1
  16. package/lib/build/provider/hana/template/.hdiconfig-all +7 -1
  17. package/lib/build/provider/hana/template/package.json +1 -1
  18. package/lib/build/provider/internalBuildPlugin.js +15 -1
  19. package/lib/build/provider/java/index.js +12 -1
  20. package/lib/build/provider/mtx-sidecar/index.js +2 -1
  21. package/lib/build/provider/nodejs/index.js +2 -1
  22. package/lib/build/util.js +36 -19
  23. package/lib/compile/to_openapi.js +1 -5
  24. package/lib/import/common.js +9 -2
  25. package/lib/import/odata/ParserContext.js +1 -0
  26. package/lib/import/odata/v4parser.js +57 -25
  27. package/lib/import/openapi/importOpenAPI.js +6 -1
  28. package/lib/init/constants.js +1 -1
  29. package/lib/init/index.js +20 -6
  30. package/lib/init/merge.js +16 -0
  31. package/lib/init/projectReader.js +34 -8
  32. package/lib/init/registries/mta.js +2 -2
  33. package/lib/init/template/ams/index.js +3 -3
  34. package/lib/init/template/app-frontend/files/app-package.json.hbs +1 -7
  35. package/lib/init/template/app-frontend/files/ui5.yaml.hbs +21 -1
  36. package/lib/init/template/app-frontend/index.js +2 -6
  37. package/lib/init/template/application-logging/index.js +11 -16
  38. package/lib/init/template/approuter/files/mta.yaml.hbs +0 -2
  39. package/lib/init/template/approuter/index.js +13 -10
  40. package/lib/init/template/attachments/index.js +4 -2
  41. package/lib/init/template/audit-logging/index.js +4 -2
  42. package/lib/init/template/cloud-logging/index.js +6 -5
  43. package/lib/init/template/connectivity/index.js +2 -2
  44. package/lib/init/template/console/files/package.json +5 -0
  45. package/lib/init/template/console/index.js +25 -0
  46. package/lib/init/template/containerize/index.js +4 -6
  47. package/lib/init/template/data/as-json.js +18 -20
  48. package/lib/init/template/destination/index.js +4 -2
  49. package/lib/init/template/dynatrace/files/package.json.hbs +2 -2
  50. package/lib/init/template/dynatrace/index.js +4 -4
  51. package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +3 -1
  52. package/lib/init/template/enterprise-messaging/index.js +4 -2
  53. package/lib/init/template/enterprise-messaging-shared/index.js +4 -2
  54. package/lib/init/template/github-actions/files/workflows/cf.yaml.hbs +16 -1
  55. package/lib/init/template/github-actions/files/workflows/release.yaml.hbs +2 -2
  56. package/lib/init/template/github-actions/files/workflows/test.yaml.hbs +20 -0
  57. package/lib/init/template/github-actions/index.js +7 -10
  58. package/lib/init/template/hana/files/db/package.json +2 -2
  59. package/lib/init/template/hana/files/mta.yaml.hbs +0 -4
  60. package/lib/init/template/hana/index.js +7 -9
  61. package/lib/init/template/helm/index.js +8 -10
  62. package/lib/init/template/helm-unified-runtime/index.js +1 -4
  63. package/lib/init/template/html5-repo/files/app-package.json.hbs +1 -7
  64. package/lib/init/template/html5-repo/files/ui5.yaml.hbs +21 -1
  65. package/lib/init/template/html5-repo/index.js +14 -18
  66. package/lib/init/template/ias/files/values.yaml.hbs +6 -6
  67. package/lib/init/template/ias/index.js +13 -21
  68. package/lib/init/template/java/index.js +14 -0
  69. package/lib/init/template/kafka/index.js +4 -2
  70. package/lib/init/template/{containerize → kyma}/files/containerize.yaml.hbs +17 -2
  71. package/lib/init/template/kyma/index.js +129 -5
  72. package/lib/init/template/malware-scanner/files/mta.yaml.hbs +3 -1
  73. package/lib/init/template/malware-scanner/files/values.yaml +3 -1
  74. package/lib/init/template/malware-scanner/index.js +4 -2
  75. package/lib/init/template/multitenancy/files/mta.yaml.hbs +1 -3
  76. package/lib/init/template/multitenancy/files/values.yaml.hbs +8 -0
  77. package/lib/init/template/multitenancy/index.js +15 -7
  78. package/lib/init/template/nodejs/files/.vscode/extensions.json +0 -3
  79. package/lib/init/template/nodejs/files/package.json.hbs +1 -1
  80. package/lib/init/template/pipeline/files/app-package.json.hbs +1 -7
  81. package/lib/init/template/pipeline/files/ui5.yaml.hbs +21 -1
  82. package/lib/init/template/pipeline/index.js +1 -2
  83. package/lib/init/template/portal/files/mta.yaml.hbs +5 -3
  84. package/lib/init/template/portal/index.js +8 -8
  85. package/lib/init/template/postgres/index.js +2 -2
  86. package/lib/init/template/redis/index.js +2 -3
  87. package/lib/init/template/redis-messaging/index.js +2 -3
  88. package/lib/init/template/sample/files/_i18n/i18n_de.properties +21 -0
  89. package/lib/init/template/sample/files/_i18n/i18n_en.properties +21 -0
  90. package/lib/init/template/sample/files/_i18n/i18n_fr.properties +21 -0
  91. package/lib/init/template/sample/files/_i18n/messages_de.properties +34 -0
  92. package/lib/init/template/sample/files/_i18n/messages_en.properties +34 -0
  93. package/lib/init/template/sample/files/_i18n/messages_fr.properties +34 -0
  94. package/lib/init/template/sample/files/app/_i18n/i18n.properties +13 -25
  95. package/lib/init/template/sample/files/app/_i18n/i18n_de.properties +13 -25
  96. package/lib/init/template/sample/files/app/admin-authors/fiori-service.cds +52 -0
  97. package/lib/init/template/sample/files/app/admin-authors/webapp/Component.js.hbs +3 -0
  98. package/lib/init/template/sample/files/app/admin-authors/webapp/i18n/i18n.properties +3 -0
  99. package/lib/init/template/sample/files/app/admin-authors/webapp/i18n/i18n_de.properties +3 -0
  100. package/lib/init/template/sample/files/app/admin-authors/webapp/i18n/i18n_en.properties +3 -0
  101. package/lib/init/template/sample/files/app/admin-authors/webapp/manifest.json +130 -0
  102. package/lib/init/template/sample/files/app/admin-books/fiori-service.cds +81 -88
  103. package/lib/init/template/sample/files/app/admin-books/webapp/Component.js.hbs +3 -0
  104. package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n.properties +3 -3
  105. package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_de.properties +3 -3
  106. package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_en.properties +3 -3
  107. package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +24 -48
  108. package/lib/init/template/sample/files/app/appconfig/fioriSandboxConfig.json +56 -5
  109. package/lib/init/template/sample/files/app/browse/fiori-service.cds +30 -30
  110. package/lib/init/template/sample/files/app/browse/webapp/Component.js.hbs +3 -0
  111. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n.properties +3 -4
  112. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_de.properties +3 -3
  113. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_en.properties +3 -4
  114. package/lib/init/template/sample/files/app/browse/webapp/manifest.json +19 -24
  115. package/lib/init/template/sample/files/app/common.cds +127 -158
  116. package/lib/init/template/sample/files/app/fiori-apps.html +50 -0
  117. package/lib/init/template/sample/files/app/genres/fiori-service.cds +33 -0
  118. package/lib/init/template/sample/files/app/genres/tree-view.cds +42 -0
  119. package/lib/init/template/sample/files/app/genres/value-help.cds +6 -0
  120. package/lib/init/template/sample/files/app/genres/webapp/Component.js.hbs +3 -0
  121. package/lib/init/template/sample/files/app/genres/webapp/i18n/i18n.properties +3 -0
  122. package/lib/init/template/sample/files/app/genres/webapp/i18n/i18n_de.properties +3 -0
  123. package/lib/init/template/sample/files/app/genres/webapp/i18n/i18n_en.properties +3 -0
  124. package/lib/init/template/sample/files/app/genres/webapp/manifest.json +126 -0
  125. package/lib/init/template/sample/files/app/services.cds +6 -2
  126. package/lib/init/template/sample/files/db/currencies.cds +13 -0
  127. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books.csv +5 -5
  128. package/lib/init/template/sample/files/db/data/{sap.capire.bookshop-Books_texts.csv → sap.capire.bookshop-Books.texts.csv} +4 -4
  129. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Genres.csv +42 -15
  130. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Genres.texts.csv +43 -0
  131. package/lib/init/template/sample/files/db/data/sap.common-Currencies.csv +12 -0
  132. package/lib/init/template/sample/files/db/data/sap.common-Currencies.texts.csv +15 -0
  133. package/lib/init/template/sample/files/db/hana/index.cds +10 -0
  134. package/lib/init/template/sample/files/db/schema.cds +35 -22
  135. package/lib/init/template/sample/files/db/sqlite/index.cds +10 -0
  136. package/lib/init/template/sample/files/package.json.hbs +14 -1
  137. package/lib/init/template/sample/files/srv/access-control.cds +3 -0
  138. package/lib/init/template/sample/files/srv/admin-service.cds +3 -2
  139. package/lib/init/template/sample/files/srv/cat-service.cds +7 -11
  140. package/lib/init/template/sample/index.js +40 -18
  141. package/lib/init/template/sqlite/files/package.json.hbs +13 -0
  142. package/lib/init/template/sqlite/index.js +1 -1
  143. package/lib/init/template/telemetry/index.js +1 -3
  144. package/lib/init/template/typescript/files/package.json +1 -1
  145. package/lib/init/template/workzone-standard/files/mta.yaml.hbs +0 -5
  146. package/lib/init/template/workzone-standard/index.js +0 -1
  147. package/lib/init/template/xsuaa/files/mta.yaml.hbs +4 -0
  148. package/lib/init/template/xsuaa/index.js +7 -6
  149. package/lib/lint/Linter.js +10 -4
  150. package/lib/lint/eslintHelp.json +1 -1
  151. package/lib/mtx/tenant_action.js +12 -4
  152. package/lib/util/checksum.js +41 -0
  153. package/lib/util/fs.js +8 -1
  154. package/lib/util/glob.js +26 -13
  155. package/lib/util/question.js +60 -7
  156. package/npm-shrinkwrap.json +141 -118
  157. package/package.json +2 -2
  158. package/lib/init/template/app-frontend/files/ui5-deploy.yaml.hbs +0 -25
  159. package/lib/init/template/github-actions/files/cf-setup/action.yaml +0 -53
  160. package/lib/init/template/html5-repo/files/ui5-deploy.yaml.hbs +0 -25
  161. package/lib/init/template/pipeline/files/ui5-deploy.yaml.hbs +0 -25
  162. package/lib/init/template/sample/files/app/admin-books/webapp/Component.js +0 -8
  163. package/lib/init/template/sample/files/app/browse/webapp/Component.js +0 -7
  164. package/lib/init/template/sample/files/app/index.html +0 -32
  165. package/lib/init/template/sqlite/files/package.json +0 -5
  166. /package/lib/init/template/{helm → kyma}/files/Chart.yaml.hbs +0 -0
  167. /package/lib/init/template/{helm → kyma}/files/values.schema.json +0 -0
  168. /package/lib/init/template/{helm → kyma}/files/values.yaml.hbs +0 -0
@@ -1,8 +1,10 @@
1
1
  const cds = require('../../../cds')
2
2
  const { merge, sort } = require('../../merge')
3
3
 
4
+ const mvn = require('../../mvn')
4
5
  const { readProject } = require('../../projectReader')
5
6
  const { srv4, mtxSidecar4, approuter } = require('../../registries/mta')
7
+ const KymaTemplate = require('../kyma')
6
8
 
7
9
  module.exports = class extends require('../../plugin') {
8
10
 
@@ -32,12 +34,13 @@ module.exports = class extends require('../../plugin') {
32
34
  await sort('package.json', 'dependencies')
33
35
  } else if (isJava) {
34
36
  await merge(__dirname, 'files/java-cdsrc.json.hbs').into('.cdsrc.json', { with: project })
37
+ await mvn.add('APPLICATION_LOGGING')
35
38
  }
36
39
  }
37
40
 
38
41
  async combine() {
39
42
  const project = readProject()
40
- const { hasMta, addMta, addHelm, addHelmUnifiedRuntime, addApprouter, isJava, addMultitenancy, srvPath } = project
43
+ const { hasMta, addMta, addKyma, addApprouter, isJava, addMultitenancy, srvPath } = project
41
44
 
42
45
  if (addMta || (addMultitenancy || addApprouter) && hasMta) {
43
46
  const cloudLogging = {
@@ -50,7 +53,6 @@ module.exports = class extends require('../../plugin') {
50
53
  const additions = [cloudLogging], relationships = []
51
54
  const srv = srv4(srvPath)
52
55
  if (addMta) {
53
- additions.push(srv)
54
56
  relationships.push({
55
57
  insert: [cloudLogging, 'name'],
56
58
  into: [srv, 'requires', 'name']
@@ -58,14 +60,12 @@ module.exports = class extends require('../../plugin') {
58
60
  }
59
61
  if (addMultitenancy) {
60
62
  const mtxSidecar = mtxSidecar4(isJava ? 'mtx/sidecar' : 'gen/mtx/sidecar')
61
- additions.push(mtxSidecar)
62
63
  relationships.push({
63
64
  insert: [cloudLogging, 'name'],
64
65
  into: [mtxSidecar, 'requires', 'name']
65
66
  })
66
67
  }
67
68
  if (addApprouter) {
68
- additions.push(approuter)
69
69
  relationships.push({
70
70
  insert: [cloudLogging, 'name'],
71
71
  into: [approuter, 'requires', 'name']
@@ -77,8 +77,9 @@ module.exports = class extends require('../../plugin') {
77
77
  with: project, additions, relationships
78
78
  })
79
79
  }
80
- if (addHelm || addHelmUnifiedRuntime) {
80
+ if (addKyma) {
81
81
  await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml')
82
+ await KymaTemplate.mergeDependency('service-instance', 'cloud-logging')
82
83
  }
83
84
  }
84
85
  }
@@ -20,7 +20,7 @@ module.exports = class ConnectivityTemplate extends require('../../plugin') {
20
20
 
21
21
  async combine() {
22
22
  const project = readProject()
23
- const { srvPath, addHelm, addHelmUnifiedRuntime, addMta } = project
23
+ const { srvPath, addKyma, addMta } = project
24
24
 
25
25
  if (addMta) {
26
26
  const srv = srv4(srvPath)
@@ -32,7 +32,7 @@ module.exports = class ConnectivityTemplate extends require('../../plugin') {
32
32
  await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', { project, additions, relationships })
33
33
  }
34
34
 
35
- if (addHelm || addHelmUnifiedRuntime) {
35
+ if (addKyma) {
36
36
  await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml', {
37
37
  project,
38
38
  additions: [{
@@ -0,0 +1,5 @@
1
+ {
2
+ "dependencies": {
3
+ "@cap-js/console": "^1.0.0"
4
+ }
5
+ }
@@ -0,0 +1,25 @@
1
+ const { join } = require("path");
2
+ const mvn = require("../../mvn");
3
+
4
+ const { readProject } = require("../../projectReader");
5
+ const { merge } = require("../../merge");
6
+
7
+ module.exports = class ConsoleTemplate extends require("../../plugin") {
8
+ static help() {
9
+ return "installs the CAP console plugin";
10
+ }
11
+
12
+ async run() {
13
+ const { isJava } = readProject();
14
+
15
+ if (isJava) {
16
+ await mvn.add("CAP_JAVA_PLUGIN", {
17
+ groupId: "com.sap.cds",
18
+ artifactId: "cds-feature-console",
19
+ version: "1.0.0"
20
+ });
21
+ } else {
22
+ await merge(join(__dirname, "files", "package.json")).into("package.json");
23
+ }
24
+ }
25
+ };
@@ -2,23 +2,21 @@ const cds = require('../../../cds')
2
2
  const { exists, rimraf } = cds.utils
3
3
  const { readProject } = require('../../projectReader');
4
4
  const { merge } = require('../../merge')
5
+ const term = require('../../../../lib/util/term')
5
6
 
7
+ // cds10: Remove this and all usages of addContainerize/hasContainerize
6
8
  module.exports = class ContainerizeTemplate extends require('../../plugin') {
7
9
 
8
- static help() {
9
- return 'containerization using ctz CLI'
10
- }
11
-
12
10
  static hasInProduction () {
13
11
  return exists('containerize.yaml')
14
12
  }
15
-
16
13
  async run() {
14
+ console.warn(term.warn(`The "cds add containerize" command is deprecated and will be removed in the next major release. Please use the "cds add kyma" command instead.`))
17
15
  if (cds.cli.options.force) {
18
16
  await rimraf('containerize.yaml')
19
17
  }
20
18
 
21
19
  const project = readProject()
22
- await merge(__dirname, '/files/containerize.yaml.hbs').into('containerize.yaml', { with: project })
20
+ await merge(__dirname, '../kyma/files/containerize.yaml.hbs').into('containerize.yaml', { with: project })
23
21
  }
24
22
  }
@@ -12,7 +12,7 @@ const MAX_ASSOC_DEPTH = 5
12
12
  * @param {object} csn the model
13
13
  * @param {Number} numRecords the number of records to be created for each artifact
14
14
  * @param {{referenceData? : Record<string, string}} options misc. options
15
- * @returns {Record<string, object[]>} the filled data
15
+ * @returns {Promise<Record<string, object[]>>} the filled data
16
16
  */
17
17
  const asJson = module.exports = async (data, csn, numRecords=1, options={}) => {
18
18
  let { referenceData, contentType, artifact='entity' } = options
@@ -66,10 +66,10 @@ const asJson = module.exports = async (data, csn, numRecords=1, options={}) => {
66
66
  data[name] = uniqRecords(data[name], artifact)
67
67
  }
68
68
  for (let [key, d] of Object.entries(data)) {
69
- if (contentType === 'json' && d.deleteReference && !d.keepReferece) {
69
+ if (contentType === 'json' && d.deleteReference && !d.keepReference) {
70
70
  delete data[key]
71
71
  }
72
- delete d.keepReferece
72
+ delete d.keepReference
73
73
  delete d.deleteReference
74
74
  uniqRecords(d, csn.definitions[key])
75
75
  }
@@ -235,7 +235,10 @@ function dataForField(element, artifact, csn, record, data, parent, depth, refer
235
235
  const prec = element.precision ? Math.min(Math.pow(10, element.precision - scale) - 1, Number.MAX_SAFE_INTEGER) : 100
236
236
  const range = { from: 0, to: prec }
237
237
  annotatedIntRange(element, range)
238
- return +(randomDecimalInRange(range).toFixed(scale))
238
+ if (scale === 0) return randomIntInRange(range)
239
+ const intPart = randomIntInRange(range)
240
+ const frac = Math.floor(randomUnit() * Math.pow(10, scale))
241
+ return +(intPart + frac / Math.pow(10, scale)).toFixed(scale)
239
242
  }
240
243
  case 'cds.Double': {
241
244
  const range = {from: 0, to: 100}
@@ -287,7 +290,7 @@ function dataForField(element, artifact, csn, record, data, parent, depth, refer
287
290
  else if (!targetRecords) // target entity is not in the list of entities to be created
288
291
  return
289
292
 
290
- if (targetRecords.length > 0) { // use record generated by following asociation
293
+ if (targetRecords.length > 0) { // use record generated by following association
291
294
  targetRecord = targetRecords.at(-1) // make sure the localized record references the newly generated texts
292
295
  } else {
293
296
  targetRecord = fillRecord({}, randomNumber(), target, csn, data, artifact, depth+1, referenceData)
@@ -295,7 +298,7 @@ function dataForField(element, artifact, csn, record, data, parent, depth, refer
295
298
  targetRecords.push(targetRecord)
296
299
  uniqRecords(targetRecords, target)
297
300
  }
298
- if (parent && (parent.name != artifact.name)) data[target.name].keepReferece = true
301
+ if (parent && (parent.name != artifact.name)) data[target.name].keepReference = true
299
302
  }
300
303
  }
301
304
 
@@ -371,7 +374,7 @@ asJson.randomFromReferenceData = function(entity, csn, referenceData) {
371
374
  /* whether the given name matches the entity or one of its projections */
372
375
  function matchesEntityOrProjection(name, entity, csn) {
373
376
  if (name === entity?.name) return true
374
- // follow simle projections
377
+ // follow simple projections
375
378
  const p = entity?.query?.SELECT || entity?.projection
376
379
  if (p?.from?.ref?.length === 1) {
377
380
  if (p.from.ref[0] === name) return true
@@ -551,21 +554,13 @@ function randomDateInRange(dateRange) {
551
554
  return returnDate
552
555
  }
553
556
 
554
- function randomDecimalInRange(decimalRange) {
555
- const max = decimalRange.to
556
- const min = decimalRange.from
557
- const num = max === 0 ? 0 : min + (randomNumber() % (max - min))
558
- let dec = randomNumber()
559
- const divider = Math.pow(10, dec.toString().length)
560
- dec = dec / divider
561
- const returnValue = num + dec
562
- return returnValue
557
+ function randomDecimalInRange({ from: min, to: max }) {
558
+ return min + randomUnit() * (max - min)
563
559
  }
564
560
 
565
- function randomIntInRange(intRange) {
566
- const max = intRange.to
567
- const min = intRange.from
568
- return min + (randomNumber() % max)
561
+ function randomIntInRange({ from: min, to: max }) {
562
+ const span = Math.max(0, max - min + 1)
563
+ return min + Math.floor(randomUnit() * span)
569
564
  }
570
565
 
571
566
  const p = 5651;
@@ -575,3 +570,6 @@ function randomNumber() {
575
570
  counter = (counter * counter) % M
576
571
  return counter;
577
572
  }
573
+ function randomUnit() {
574
+ return randomNumber() / (M - 1) // ~[0,1]
575
+ }
@@ -1,6 +1,7 @@
1
1
  const { readProject } = require('../../projectReader')
2
2
  const { merge } = require('../../merge')
3
3
  const { srv4, approuter, destination, mtxSidecar4 } = require('../../registries/mta')
4
+ const KymaTemplate = require('../kyma')
4
5
 
5
6
  module.exports = class DestinationTemplate extends require('../../plugin') {
6
7
 
@@ -24,7 +25,7 @@ module.exports = class DestinationTemplate extends require('../../plugin') {
24
25
 
25
26
  async combine() {
26
27
  const project = readProject()
27
- const { addHelm, addApprouter, addMultitenancy, addHelmUnifiedRuntime, addMta, hasMta, srvPath, isJava } = project
28
+ const { addApprouter, addMultitenancy, addKyma, addMta, hasMta, srvPath, isJava } = project
28
29
 
29
30
  if (addMta || (addApprouter || addMultitenancy) && hasMta) {
30
31
  const srv = srv4(srvPath)
@@ -48,8 +49,9 @@ module.exports = class DestinationTemplate extends require('../../plugin') {
48
49
  await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', { with: project, additions, relationships })
49
50
  }
50
51
 
51
- if (addHelm || addHelmUnifiedRuntime) {
52
+ if (addKyma) {
52
53
  await merge(__dirname, 'files/values.yaml').into('chart/values.yaml')
54
+ await KymaTemplate.mergeDependency('service-instance', 'destination')
53
55
  }
54
56
  }
55
57
  }
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "dependencies": {
3
3
  "@cap-js/telemetry": ">=0",
4
- "@opentelemetry/exporter-metrics-otlp-proto": "<0.200"{{#hasHelm}},
4
+ "@opentelemetry/exporter-metrics-otlp-proto": "<0.200"{{#hasKyma}},
5
5
  "@opentelemetry/host-metrics": "<0.200"
6
- {{/hasHelm}}
6
+ {{/hasKyma}}
7
7
  },
8
8
  "cds": {
9
9
  "requires": {
@@ -2,6 +2,7 @@ const { merge, sort } = require('../../merge')
2
2
 
3
3
  const { readProject } = require('../../projectReader')
4
4
  const { srv4, mtxSidecar4 } = require('../../registries/mta')
5
+ const KymaTemplate = require('../kyma')
5
6
 
6
7
  module.exports = class extends require('../../plugin') {
7
8
 
@@ -24,7 +25,7 @@ module.exports = class extends require('../../plugin') {
24
25
 
25
26
  async combine() {
26
27
  const project = readProject()
27
- const { appName, addMta, addHelm, addHelmUnifiedRuntime, isJava, addMultitenancy, srvPath } = project
28
+ const { appName, addMta, addKyma, isJava, addMultitenancy, srvPath } = project
28
29
 
29
30
  if (addMta || addMultitenancy) {
30
31
  const dynatrace = {
@@ -37,7 +38,6 @@ module.exports = class extends require('../../plugin') {
37
38
  const additions = [dynatrace], relationships = []
38
39
  if (addMta) {
39
40
  const srv = srv4(srvPath)
40
- additions.push(srv)
41
41
  relationships.push({
42
42
  insert: [dynatrace, 'name'],
43
43
  into: [srv, 'requires', 'name']
@@ -45,7 +45,6 @@ module.exports = class extends require('../../plugin') {
45
45
  }
46
46
  if (addMultitenancy) {
47
47
  const mtxSidecar = mtxSidecar4(isJava ? 'mtx/sidecar' : 'gen/mtx/sidecar')
48
- additions.push(mtxSidecar)
49
48
  relationships.push({
50
49
  insert: [dynatrace, 'name'],
51
50
  into: [mtxSidecar, 'requires', 'name']
@@ -57,8 +56,9 @@ module.exports = class extends require('../../plugin') {
57
56
  })
58
57
  }
59
58
 
60
- if (addHelm || addHelmUnifiedRuntime) {
59
+ if (addKyma) {
61
60
  await merge(__dirname, 'files', 'values.yaml').into('chart/values.yaml')
61
+ await KymaTemplate.mergeDependency('service-instance', 'dynatrace')
62
62
  }
63
63
  }
64
64
  }
@@ -13,7 +13,9 @@ resources:
13
13
  service: enterprise-messaging
14
14
  service-plan: default
15
15
  path: ./event-mesh.json
16
- - type: org.cloudfoundry.managed-service
16
+
17
+ - name: {{appName}}-auth
18
+ type: org.cloudfoundry.managed-service
17
19
  parameters:
18
20
  service: xsuaa
19
21
  service-plan: application
@@ -3,6 +3,7 @@ const { read, exists, yaml: YAML } = cds.utils
3
3
  const { readProject } = require('../../projectReader')
4
4
  const { merge } = require('../../merge')
5
5
  const { srv4, enterpriseMessaging, xsuaa } = require('../../registries/mta')
6
+ const KymaTemplate = require('../kyma')
6
7
 
7
8
  module.exports = class EnterpriseMessagingTemplate extends require('../../plugin') {
8
9
 
@@ -41,7 +42,7 @@ module.exports = class EnterpriseMessagingTemplate extends require('../../plugin
41
42
 
42
43
  async combine() {
43
44
  const project = readProject()
44
- const { addXsuaa, addHelm, addHelmUnifiedRuntime, addMta, srvPath, appName } = project
45
+ const { addXsuaa, addKyma, addMta, srvPath, appName } = project
45
46
 
46
47
  if (addMta) {
47
48
  const srv = srv4(srvPath)
@@ -72,8 +73,9 @@ module.exports = class EnterpriseMessagingTemplate extends require('../../plugin
72
73
  })
73
74
  }
74
75
 
75
- if (addHelm || addHelmUnifiedRuntime) {
76
+ if (addKyma) {
76
77
  await merge(__dirname, 'files', 'values.yaml').into('chart/values.yaml')
78
+ await KymaTemplate.mergeDependency('service-instance', 'event-mesh')
77
79
  }
78
80
 
79
81
  if (!exists('event-mesh.json')) await merge(__dirname, 'files/event-mesh.json.hbs').into('event-mesh.json', { project })
@@ -3,6 +3,7 @@ const { read, exists } = cds.utils
3
3
  const { readProject } = require('../../projectReader')
4
4
  const { merge } = require('../../merge')
5
5
  const { srv4, enterpriseMessaging } = require('../../registries/mta')
6
+ const KymaTemplate = require('../kyma')
6
7
 
7
8
  module.exports = class EnterpriseMessagingSharedTemplate extends require('../../plugin') {
8
9
 
@@ -42,7 +43,7 @@ module.exports = class EnterpriseMessagingSharedTemplate extends require('../../
42
43
 
43
44
  async combine() {
44
45
  const project = readProject()
45
- const { addMta, addHelm, addHelmUnifiedRuntime, srvPath } = project
46
+ const { addMta, addKyma, srvPath } = project
46
47
 
47
48
  if (addMta) {
48
49
  const srv = srv4(srvPath)
@@ -56,8 +57,9 @@ module.exports = class EnterpriseMessagingSharedTemplate extends require('../../
56
57
  })
57
58
  }
58
59
 
59
- if (addHelm || addHelmUnifiedRuntime) {
60
+ if (addKyma) {
60
61
  await merge(__dirname, 'files/values.yaml').into('chart/values.yaml')
62
+ await KymaTemplate.mergeDependency('service-instance', 'event-mesh')
61
63
  }
62
64
 
63
65
  if (!exists('event-mesh.json')) await merge(__dirname, 'files/event-mesh.json.hbs').into('event-mesh.json', { project })
@@ -29,7 +29,22 @@ jobs:
29
29
  - uses: actions/setup-node@v5
30
30
  with:
31
31
  node-version: 22
32
- - uses: ./.github/actions/cf-setup
32
+ {{#isJava}}
33
+ - uses: actions/setup-java@v5
34
+ with:
35
+ distribution: sapmachine
36
+ java-version: 21
37
+ cache: maven
38
+ {{#sap}}
39
+ - name: Install Maven
40
+ run: |
41
+ MAVEN_VERSION=3.9.6
42
+ curl -fsSL "https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz" -o maven.tgz
43
+ tar -xzf maven.tgz
44
+ echo "${PWD}/apache-maven-${MAVEN_VERSION}/bin" >> "$GITHUB_PATH"
45
+ {{/sap}}
46
+ {{/isJava}}
47
+ - uses: cap-js/cf-setup@v1
33
48
  with:
34
49
  cf-api: {{#literal}}${{ vars.CF_API }}{{/literal}}
35
50
  cf-org: {{#literal}}${{ vars.CF_ORG }}{{/literal}}
@@ -20,11 +20,11 @@ jobs:
20
20
  secrets: inherit
21
21
  with:
22
22
  environment: Production
23
- {{/hasMta}}{{^hasMta}}{{#hasHelm}}
23
+ {{/hasMta}}{{^hasMta}}{{#hasKyma}}
24
24
  deploy-kyma:
25
25
  needs: [tests]
26
26
  uses: {{& githubSlug}}/.github/workflows/kyma.yaml@main
27
27
  secrets: inherit
28
28
  with:
29
29
  environment: Production
30
- {{/hasHelm}}{{/hasMta}}
30
+ {{/hasKyma}}{{/hasMta}}
@@ -21,4 +21,24 @@ jobs:
21
21
  node-version: 22
22
22
  - uses: actions/checkout@v5
23
23
  - run: npm install
24
+ {{#isJava}}
25
+ - uses: actions/setup-java@v5
26
+ with:
27
+ distribution: sapmachine
28
+ java-version: 21
29
+ cache: maven
30
+ {{#sap}}
31
+ - name: Install Maven
32
+ run: |
33
+ MAVEN_VERSION=3.9.6
34
+ curl -fsSL "https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz" -o maven.tgz
35
+ tar -xzf maven.tgz
36
+ echo "${PWD}/apache-maven-${MAVEN_VERSION}/bin" >> "$GITHUB_PATH"
37
+ {{/sap}}
38
+ {{/isJava}}
39
+ {{#isNodejs}}
24
40
  - run: npm test
41
+ {{/isNodejs}}
42
+ {{#isJava}}
43
+ - run: mvn test -B
44
+ {{/isJava}}
@@ -24,9 +24,11 @@ module.exports = class GitHubActionTemplate extends require('../../plugin') {
24
24
  }
25
25
 
26
26
  async run() {
27
+ const { hasMta, hasKyma, isJava } = readProject()
27
28
  const test = `.github/workflows/test.yaml`
28
- if (!exists(test) || cds.cli.options.force) {
29
- await renderAndCopy(path.join(__dirname, 'files/workflows/test.yaml.hbs'), test, { sap: cds.cli.options.sap })
29
+ const { force, sap } = cds.cli.options
30
+ if (!exists(test) || force) {
31
+ await renderAndCopy(path.join(__dirname, 'files/workflows/test.yaml.hbs'), test, { sap, isJava })
30
32
  } else {
31
33
  console.log('> skipping ' + test)
32
34
  }
@@ -41,8 +43,7 @@ module.exports = class GitHubActionTemplate extends require('../../plugin') {
41
43
  githubSlug = '<org/repo>'
42
44
  // console.log(`\ncould not determine GitHub URL for the project – replace '<org/repo>' in ${release}`, DEBUG ? error : '')
43
45
  }
44
- const { hasMta, hasHelm } = readProject()
45
- await renderAndCopy(path.join(__dirname, 'files/workflows/release.yaml.hbs'), release, { sap: cds.cli.options.sap, githubSlug, hasMta, hasHelm })
46
+ await renderAndCopy(path.join(__dirname, 'files/workflows/release.yaml.hbs'), release, { isJava, sap: cds.cli.options.sap, githubSlug, hasMta, hasKyma })
46
47
  } else {
47
48
  console.log('> skipping ' + release)
48
49
  }
@@ -50,19 +51,15 @@ module.exports = class GitHubActionTemplate extends require('../../plugin') {
50
51
 
51
52
  async combine() {
52
53
  const project = readProject()
53
- const { addMta, addHelm } = project, { force } = cds.cli.options
54
+ const { addMta, addKyma } = project, { force } = cds.cli.options
54
55
  project.sap = cds.cli.options.sap
55
56
  if (addMta) {
56
57
  const cf = '.github/workflows/cf.yaml'
57
58
  if (force || !exists(cf)) {
58
59
  await renderAndCopy(path.join(__dirname, 'files/workflows/cf.yaml.hbs'), cf, project)
59
60
  }
60
- const cfSetup = '.github/actions/cf-setup'
61
- if (force || !exists(cfSetup)) {
62
- await copy(path.join(__dirname, 'files/cf-setup'), cfSetup)
63
- }
64
61
  }
65
- if (addHelm) {
62
+ if (addKyma) {
66
63
  const kyma = '.github/workflows/kyma.yaml'
67
64
  if (force || !exists(kyma)) {
68
65
  await renderAndCopy(path.join(__dirname, 'files/workflows/kyma.yaml.hbs'), kyma, project)
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "deploy",
3
3
  "dependencies": {
4
- "hdb": "^0",
4
+ "hdb": "^2.0.0",
5
5
  "@sap/hdi-deploy": "^5"
6
6
  },
7
7
  "engines": {
8
- "node": "^22.0.0"
8
+ "node": "^24.0.0"
9
9
  },
10
10
  "scripts": {
11
11
  "start": "node node_modules/@sap/hdi-deploy/deploy.js --use-hdb --parameter com.sap.hana.di.table/try_fast_table_migration=true",
@@ -6,7 +6,6 @@ modules:
6
6
  requires:
7
7
  - name: {{appName}}-db
8
8
 
9
- {{^hasMultitenancy}}
10
9
  - name: {{appName}}-db-deployer
11
10
  type: hdb
12
11
  path: {{& db.path}}
@@ -20,15 +19,12 @@ modules:
20
19
  {{/isJava}}
21
20
  requires:
22
21
  - name: {{appName}}-db
23
- {{/hasMultitenancy}}
24
22
 
25
- {{#hasMultitenancy}}
26
23
  - name: {{appName}}-mtx
27
24
  type: nodejs
28
25
  path: {{#isNodejs}}gen/{{/isNodejs}}mtx/sidecar
29
26
  requires:
30
27
  - name: {{appName}}-db
31
- {{/hasMultitenancy}}
32
28
 
33
29
  resources:
34
30
  - name: {{appName}}-db
@@ -23,8 +23,7 @@ module.exports = class HanaTemplate extends require('../../plugin') {
23
23
  const { isJava, configFile, db } = project
24
24
  project.shortcut = !exists(configFile) || typeof (await read(configFile)).cds?.requires?.db !== 'object'
25
25
 
26
- // REVISIT: Let cds build generate those by default
27
- await merge(__dirname, 'files/src/.hdiconfig').into(join(db.folder, 'src/.hdiconfig'))
26
+ // cds10: Let cds build generate this by default
28
27
  await merge(__dirname, 'files/undeploy.json').into(join(db.folder, 'undeploy.json'))
29
28
 
30
29
  if (isJava) {
@@ -44,9 +43,9 @@ module.exports = class HanaTemplate extends require('../../plugin') {
44
43
 
45
44
  async combine() {
46
45
  const project = readProject()
47
- const { addMta, hasMta, addHelm, addHelmUnifiedRuntime, addMultitenancy, addContainerize, isJava, hasHelm, hasHelmUnifiedRuntime, hasMultitenancy, srvPath } = project
46
+ const { addMta, hasMta, addMultitenancy, addContainerize, addKyma, isJava, hasKyma, hasMultitenancy, srvPath } = project
48
47
 
49
- if (addMta || (addMultitenancy && hasMta)) {
48
+ if (addMta || addMultitenancy && hasMta) {
50
49
  const srv = srv4(srvPath)
51
50
  const db = hasMultitenancy ? serviceManager : hdiContainer
52
51
  const deletions = hasMultitenancy ? [{
@@ -82,16 +81,15 @@ module.exports = class HanaTemplate extends require('../../plugin') {
82
81
 
83
82
  const modules = hasMultitenancy ? [srv] : [srv, hdbDeployer]
84
83
  await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', {
85
- with: project, additions: [...modules, db].filter(a => a), deletions, relationships
84
+ with: project, additions: [...modules, db], deletions, relationships
86
85
  })
87
86
  }
88
87
 
89
- if (!hasMultitenancy && (addHelm || addHelmUnifiedRuntime)) {
88
+ if (!hasMultitenancy && addKyma) {
90
89
  await merge(__dirname, 'files', 'values.yaml.hbs').into('chart/values.yaml', { with: project })
91
-
92
90
  }
93
91
 
94
- if (addMultitenancy && (hasHelm || hasHelmUnifiedRuntime)) {
92
+ if (addMultitenancy && hasKyma) {
95
93
  await merge('chart/values.yaml')
96
94
  .remove(['hana-deployer', 'srv.bindings.db', 'hana'])
97
95
 
@@ -102,7 +100,7 @@ module.exports = class HanaTemplate extends require('../../plugin') {
102
100
  ])
103
101
  }
104
102
 
105
- if (addContainerize && !hasMultitenancy) {
103
+ if ((addContainerize || addKyma) && !hasMultitenancy) {
106
104
  const additions = [{
107
105
  in: 'modules',
108
106
  where: { name: `${project.appName}-hana-deployer` }
@@ -6,18 +6,15 @@ const { merge } = require('../../merge')
6
6
  const { ask4 } = require('../../../util/question')
7
7
  const { execSync } = require('child_process')
8
8
  const { mvn } = require('../../add')
9
+ const term = require('../../../../lib/util/term')
9
10
 
11
+ // cds10: Remove this plugin and hasHelm doc in projectReader
10
12
  module.exports = class HelmTemplate extends require('../../plugin') {
11
13
 
12
- static help() {
13
- return 'Kyma deployment using Helm charts'
14
- }
15
-
16
14
  options() {
17
15
  return {
18
16
  'y': {
19
17
  type: 'boolean',
20
- help: 'If provided, the default values will be used for all prompts.'
21
18
  }
22
19
  }
23
20
  }
@@ -43,6 +40,7 @@ module.exports = class HelmTemplate extends require('../../plugin') {
43
40
  }
44
41
 
45
42
  async run() {
43
+ console.warn(term.warn(`The "cds add helm" command is deprecated and will be removed in the next major release. Please use the "cds add kyma" command instead.`))
46
44
  const project = readProject()
47
45
  let imagePullSecret, registry, domain, tag
48
46
  if (!HelmTemplate.hasInProduction() && !project.isBas /* don't run this for the BAS Yeoman generator */) {
@@ -58,17 +56,17 @@ module.exports = class HelmTemplate extends require('../../plugin') {
58
56
  if (t) tag = t
59
57
  }
60
58
  if (!cds.cli.options.y && !cds.cli.options.force) {
61
- registry ??= await ask4(`registry server: `)
62
- domain ??= await ask4(`cluster domain: `)
59
+ registry ??= await ask4([`registry server: `])
60
+ domain ??= await ask4([`cluster domain: `])
63
61
  }
64
62
  }
65
63
  project.registry = registry ?? '<registry-server>'
66
64
  project.domain = domain ?? '<cluster-domain>'
67
65
  project.imagePullSecret = imagePullSecret ?? 'docker-registry'
68
66
  project.tag = tag ?? 'latest'
69
- await copy(join(__dirname, 'files', 'values.schema.json')).to('chart/values.schema.json')
70
- await merge(__dirname, 'files/Chart.yaml.hbs').into('chart/Chart.yaml', { with: project })
71
- await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml', { with: project })
67
+ await copy(join(__dirname, '../kyma/files/values.schema.json')).to('chart/values.schema.json')
68
+ await merge(__dirname, '../kyma/files/Chart.yaml.hbs').into('chart/Chart.yaml', { with: project })
69
+ await merge(__dirname, '../kyma/files/values.yaml.hbs').into('chart/values.yaml', { with: project })
72
70
  await this._mergeDependency('web-application', 'srv')
73
71
  if (project.isJava) await mvn.add('k8s')
74
72
  }
@@ -6,12 +6,9 @@ const { join } = require('path')
6
6
  const { readProject } = require('../../projectReader')
7
7
  const { merge } = require('../../merge')
8
8
 
9
+ // cds10: Remove this plugin (hasHelmUnifiedRuntime is already replaced in projectReader)
9
10
  module.exports = class HelmUnifiedRuntimeTemplate extends require('../helm') {
10
11
 
11
- static help() {
12
- return 'Kyma deployment using Unified Runtime Helm charts'
13
- }
14
-
15
12
  options() {
16
13
  return {
17
14
  'internal-unified-runtime-charts': {