@sap/cds-dk 6.6.2 → 6.7.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 (117) hide show
  1. package/CHANGELOG.md +36 -1
  2. package/bin/add.js +5 -3
  3. package/bin/build/all.js +1 -1
  4. package/bin/cds.js +10 -8
  5. package/bin/env.js +4 -6
  6. package/bin/login.js +6 -4
  7. package/bin/migrate.js +0 -1
  8. package/bin/repl.js +1 -1
  9. package/bin/serve.js +7 -0
  10. package/bin/subscribe.js +5 -5
  11. package/bin/unsubscribe.js +4 -5
  12. package/bin/upgrade.js +67 -0
  13. package/bin/watch.js +8 -5
  14. package/lib/bind/bindingManager.js +3 -2
  15. package/lib/bind/cfKeyProvider.js +7 -6
  16. package/lib/bind/userCdsrcJsonStorageProvider.js +5 -4
  17. package/lib/cds.js +12 -0
  18. package/lib/client/activate.js +4 -3
  19. package/lib/client/auth_manager.js +4 -3
  20. package/lib/client/base_command.js +7 -2
  21. package/lib/client/helper/cf_helper.js +12 -11
  22. package/lib/client/helper/dependency_helper.js +3 -2
  23. package/lib/client/helper/logging.js +0 -7
  24. package/lib/client/params.js +4 -2
  25. package/lib/client/settings_manager.js +35 -34
  26. package/lib/client/tenant_action.js +78 -0
  27. package/lib/init/constants.js +1 -1
  28. package/lib/init/index.js +4 -4
  29. package/lib/init/template/_merging/registry-mta.js +31 -46
  30. package/lib/init/template/approuter/files/mta.yaml.hbs +12 -8
  31. package/lib/init/template/approuter/files/xs-app.json.hbs +0 -3
  32. package/lib/init/template/approuter/index.js +26 -34
  33. package/lib/init/template/auditlog/files/mta.yaml.hbs +2 -1
  34. package/lib/init/template/auditlog/index.js +8 -21
  35. package/lib/init/template/cf-manifest/files/manifest.yml.hbs +4 -4
  36. package/lib/init/template/cf-manifest/index.js +2 -1
  37. package/lib/init/template/connectivity/index.js +4 -5
  38. package/lib/init/template/data/index.js +19 -22
  39. package/lib/init/template/destinations/index.js +5 -17
  40. package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +2 -1
  41. package/lib/init/template/enterprise-messaging/index.js +7 -19
  42. package/lib/init/template/extensibility/index.js +3 -1
  43. package/lib/init/template/hana/files/mta.yaml.hbs +4 -5
  44. package/lib/init/template/hana/index.js +49 -84
  45. package/lib/init/template/helm/chart/templates/_helpers.tpl +4 -1
  46. package/lib/init/template/helm/files/Chart.yaml.hbs +1 -4
  47. package/lib/init/template/helm/index.js +45 -13
  48. package/lib/init/template/helm/subcharts/web-application/templates/_helpers.tpl +21 -31
  49. package/lib/init/template/helm/subcharts/web-application/templates/api-rule.yaml +3 -12
  50. package/lib/init/template/helm/subcharts/web-application/templates/deployment.yaml +12 -14
  51. package/lib/init/template/helm/subcharts/web-application/templates/network-policy.yaml +27 -4
  52. package/lib/init/template/helm/subcharts/web-application/templates/pod-disruption-budget.yaml +0 -2
  53. package/lib/init/template/helm/subcharts/web-application/templates/secret.yaml +2 -2
  54. package/lib/init/template/helm/subcharts/web-application/templates/service-account.yaml +2 -2
  55. package/lib/init/template/helm/subcharts/web-application/templates/service-binding.yaml +16 -13
  56. package/lib/init/template/helm/subcharts/web-application/templating.md +16 -9
  57. package/lib/init/template/helm/subcharts/web-application/values.md +317 -379
  58. package/lib/init/template/helm/subcharts/web-application/values.schema.json +87 -107
  59. package/lib/init/template/helm/subcharts/web-application/values.yaml +28 -2
  60. package/lib/init/template/html5-repo/index.js +6 -29
  61. package/lib/init/template/java/index.js +1 -1
  62. package/lib/init/template/kibana-logging/files/mta.yaml.hbs +2 -1
  63. package/lib/init/template/kibana-logging/index.js +5 -8
  64. package/lib/init/template/lint/index.js +8 -8
  65. package/lib/init/template/mta/files/mta.yaml.hbs +3 -2
  66. package/lib/init/template/mta/index.js +3 -2
  67. package/lib/init/template/multitenancy/files/mta.yaml.hbs +25 -31
  68. package/lib/init/template/multitenancy/files/{java/mtxs-configmap.yaml → mtxs-configmap-java.yaml} +1 -1
  69. package/lib/init/template/multitenancy/files/{mtxs-configmap.yaml → mtxs-configmap-nodejs.yaml} +5 -1
  70. package/lib/init/template/multitenancy/files/package.json.hbs +28 -0
  71. package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +21 -0
  72. package/lib/init/template/multitenancy/files/values.yaml.hbs +16 -9
  73. package/lib/init/template/multitenancy/index.js +51 -99
  74. package/lib/init/template/nodejs/files/.vscode/extensions.json +1 -2
  75. package/lib/init/template/nodejs/files/.vscode/launch.json +2 -2
  76. package/lib/init/template/nodejs/files/.vscode/tasks.json +2 -2
  77. package/lib/init/template/nodejs/files/package.json.hbs +2 -2
  78. package/lib/init/template/nodejs/index.js +4 -3
  79. package/lib/init/template/pipeline/index.js +3 -2
  80. package/lib/init/template/samples/index.js +5 -4
  81. package/lib/init/template/sqlite/files/package.json.hbs +19 -0
  82. package/lib/init/template/sqlite/index.js +11 -0
  83. package/lib/init/template/toggles/index.js +3 -5
  84. package/lib/init/template/xsuaa/files/mta.yaml.hbs +4 -5
  85. package/lib/init/template/xsuaa/files/values.yaml.hbs +0 -2
  86. package/lib/init/template/xsuaa/index.js +14 -35
  87. package/lib/init/util/commandUtil.js +3 -2
  88. package/lib/init/util/fsUtil.js +19 -2
  89. package/lib/init/util/md5Tracking.js +36 -63
  90. package/lib/init/util/projectReader.js +12 -26
  91. package/lib/lint/Linter.js +0 -3
  92. package/lib/util/exec.js +2 -1
  93. package/lib/util/term.js +1 -1
  94. package/lib/watch/livereload-connect.js +5 -4
  95. package/lib/watch/livereload-server.js +3 -6
  96. package/lib/watch/node-watch.js +1 -1
  97. package/npm-shrinkwrap.json +569 -479
  98. package/package.json +4 -4
  99. package/readme.md +1 -1
  100. package/lib/client/subscription.js +0 -84
  101. package/lib/init/template/approuter/files/chart.yaml +0 -4
  102. package/lib/init/template/auditlog/files/auditlog.yaml +0 -4
  103. package/lib/init/template/destinations/files/destination.yaml +0 -4
  104. package/lib/init/template/enterprise-messaging/files/event-mesh.yaml +0 -4
  105. package/lib/init/template/hana/files/hana-deployer.yaml +0 -4
  106. package/lib/init/template/hana/files/hana.yaml +0 -4
  107. package/lib/init/template/html5-repo/files/html5-apps-deployer.yaml +0 -4
  108. package/lib/init/template/html5-repo/files/html5-apps-repo-host.yaml +0 -4
  109. package/lib/init/template/multitenancy/files/cds.package.json +0 -7
  110. package/lib/init/template/multitenancy/files/cds.package.json.hbs +0 -9
  111. package/lib/init/template/multitenancy/files/dependencies.package.json +0 -5
  112. package/lib/init/template/multitenancy/files/java/.cdsrc.json +0 -22
  113. package/lib/init/template/multitenancy/files/java/package.json +0 -33
  114. package/lib/init/template/multitenancy/files/saas-registry.yaml +0 -4
  115. package/lib/init/template/multitenancy/files/service-manager.yaml +0 -4
  116. package/lib/init/template/multitenancy/files/sidecar.yaml +0 -4
  117. package/lib/init/template/xsuaa/files/xsuaa.yaml +0 -4
@@ -225,19 +225,6 @@
225
225
  }
226
226
  }
227
227
  },
228
- "ha": {
229
- "$id": "#/properties/ha",
230
- "title": "High Availability configuration",
231
- "type": "object",
232
- "additionalProperties": false,
233
- "properties": {
234
- "enabled": {
235
- "$id": "#/properties/ha/properties/enabled",
236
- "description": "[Deprecated: Will be always enabled in future] Enables additional high-availability related configuration, like Pod Disruption Budget and Topology Spread Constraints.",
237
- "type": "boolean"
238
- }
239
- }
240
- },
241
228
  "resources": {
242
229
  "$id": "#/properties/resources",
243
230
  "title": "Pod resources configuration",
@@ -301,39 +288,6 @@
301
288
  }
302
289
  }
303
290
  },
304
- "health_check": {
305
- "$id": "#/properties/health_check",
306
- "title": "Health-check configuration",
307
- "description": "[Deprecated] Use health instead",
308
- "type": "object",
309
- "additionalProperties": false,
310
- "properties": {
311
- "liveness": {
312
- "$id": "#/properties/health_check/properties/liveness",
313
- "description": "Liveness-probe configuration.",
314
- "type": "object",
315
- "additionalProperties": false,
316
- "properties": {
317
- "path": {
318
- "description": "HTTP path used by Kubernetes, to perform health-check calls.",
319
- "type": "string"
320
- }
321
- }
322
- },
323
- "readiness": {
324
- "$id": "#/properties/health_check/properties/readiness",
325
- "description": "Readiness-probe configuration.",
326
- "type": "object",
327
- "additionalProperties": false,
328
- "properties": {
329
- "path": {
330
- "description": "HTTP path used by Kubernetes, to perform health-check calls.",
331
- "type": "string"
332
- }
333
- }
334
- }
335
- }
336
- },
337
291
  "availability": {
338
292
  "$id": "#/properties/availability",
339
293
  "title": "Availability related configuration",
@@ -419,12 +373,6 @@
419
373
  }
420
374
  }
421
375
  },
422
- "startupTimeout": {
423
- "$id": "#/properties/startupTimeout",
424
- "description": "[Deprecated] use startupTimeoutSeconds instead",
425
- "type": "integer",
426
- "minimum": 1
427
- },
428
376
  "startupTimeoutSeconds": {
429
377
  "$id": "#/properties/startupTimeoutSeconds",
430
378
  "description": "Initial timeout in seconds, during which the app must start giving the response to the liveness-probe.",
@@ -432,6 +380,11 @@
432
380
  "minimum": 1,
433
381
  "default": 30
434
382
  },
383
+ "readOnlyRootFilesystem": {
384
+ "$id": "#/properties/readOnlyRootFilesystem",
385
+ "description": "Use read only filesystem for the Deployment.",
386
+ "type": "boolean"
387
+ },
435
388
  "terminationGracePeriodSeconds": {
436
389
  "$id": "#/properties/terminationGracePeriodSeconds",
437
390
  "description": "Time in seconds after which the pod will be forcefully stopped after receiving SIGTERM.",
@@ -603,15 +556,6 @@
603
556
  ],
604
557
  "default": {}
605
558
  },
606
- "envSecretNames": {
607
- "$id": "#/properties/envSecretNames",
608
- "description": "[Deprecated] Use `envFrom` instead",
609
- "type": "array",
610
- "uniqueItems": true,
611
- "items": {
612
- "$ref": "#/definitions/KubernetesName"
613
- }
614
- },
615
559
  "envFrom": {
616
560
  "$id": "#/properties/envFrom",
617
561
  "description": "List of sources to populate environment variables in the pod.",
@@ -681,6 +625,71 @@
681
625
  "description": "Use this istio gateway for incoming traffic.",
682
626
  "type": "string",
683
627
  "default": "kyma-gateway.kyma-system.svc.cluster.local"
628
+ },
629
+ "rules": {
630
+ "$id": "#/properties/expose/properties/rules",
631
+ "description": "Rules represents collection of Rule to apply.",
632
+ "type": "array",
633
+ "items": {
634
+ "description": "A rule to apply.",
635
+ "type": "object"
636
+ },
637
+ "default": [
638
+ {
639
+ "accessStrategies": [
640
+ {
641
+ "handler": "allow"
642
+ }
643
+ ],
644
+ "methods": [
645
+ "GET",
646
+ "POST",
647
+ "PUT",
648
+ "PATCH",
649
+ "DELETE",
650
+ "HEAD"
651
+ ],
652
+ "path": "/.*"
653
+ }
654
+ ]
655
+ }
656
+ }
657
+ },
658
+ "networkSecurity": {
659
+ "$id": "#/properties/bindings",
660
+ "title": "Network Security configuration",
661
+ "type": "object",
662
+ "additionalProperties": false,
663
+ "properties": {
664
+ "enabled": {
665
+ "type": "boolean",
666
+ "default": true
667
+ },
668
+ "allowNamespaceInternal": {
669
+ "type": "boolean"
670
+ },
671
+ "ingress": {
672
+ "type": "array",
673
+ "default": [],
674
+ "items": {
675
+ "type": "object",
676
+ "minProperties": 1,
677
+ "additionalProperties": false,
678
+ "properties": {
679
+ "namespace": {
680
+ "type": "string"
681
+ },
682
+ "podLabelsSelector": {
683
+ "type": "object",
684
+ "minProperties": 1,
685
+ "patternProperties": {
686
+ "^.*$": {
687
+ "type": "string"
688
+ }
689
+ }
690
+ }
691
+ }
692
+ }
684
693
  }
685
694
  }
686
695
  },
@@ -733,58 +742,29 @@
733
742
  "description": "List of sources to populate parameters.",
734
743
  "type": "array",
735
744
  "items": {
736
- "anyOf": [
737
- {
738
- "type": "object",
739
- "description": "Kubernetes Secret as a parameters source.",
740
- "additionalProperties": false,
741
- "properties": {
742
- "secretKeyRef": {
743
- "type": "object",
744
- "additionalProperties": false,
745
- "required": [
746
- "name",
747
- "key"
748
- ],
749
- "properties": {
750
- "name": {
751
- "description": "Name of a Secret.",
752
- "type": "string"
753
- },
754
- "key": {
755
- "description": "Key in that Secret, which contains a string that represents the json to include in the set of parameters to be sent to the broker.",
756
- "type": "string"
757
- }
758
- }
759
- }
760
- }
761
- },
762
- {
745
+ "type": "object",
746
+ "description": "Kubernetes Secret as a parameters source.",
747
+ "additionalProperties": false,
748
+ "properties": {
749
+ "secretKeyRef": {
763
750
  "type": "object",
764
- "description": "Kubernetes Config Map as a parameters source.",
765
751
  "additionalProperties": false,
752
+ "required": [
753
+ "name",
754
+ "key"
755
+ ],
766
756
  "properties": {
767
- "configMapKeyRef": {
768
- "type": "object",
769
- "additionalProperties": false,
770
- "required": [
771
- "name",
772
- "key"
773
- ],
774
- "properties": {
775
- "name": {
776
- "description": "Name of a Config Map",
777
- "$ref": "#/definitions/KubernetesName"
778
- },
779
- "key": {
780
- "description": "Key in that Config Map, which contains a string that represents the json to include in the set of parameters to be sent to the broker.",
781
- "type": "string"
782
- }
783
- }
757
+ "name": {
758
+ "description": "Name of a Secret.",
759
+ "type": "string"
760
+ },
761
+ "key": {
762
+ "description": "Key in that Secret, which contains a string that represents the json to include in the set of parameters to be sent to the broker.",
763
+ "type": "string"
784
764
  }
785
765
  }
786
766
  }
787
- ]
767
+ }
788
768
  }
789
769
  },
790
770
  "credentialsRotationPolicy": {
@@ -57,6 +57,7 @@ health:
57
57
  readiness:
58
58
  path: /healthz
59
59
 
60
+ # readOnlyRootFilesystem: false
60
61
  terminationGracePeriodSeconds: 30
61
62
  startupTimeoutSeconds: 30
62
63
 
@@ -90,8 +91,33 @@ expose:
90
91
  enabled: true
91
92
  gateway: kyma-gateway.kyma-system.svc.cluster.local
92
93
  # host: ""
94
+ rules:
95
+ - accessStrategies:
96
+ - handler: allow
97
+ methods:
98
+ - GET
99
+ - POST
100
+ - PUT
101
+ - PATCH
102
+ - DELETE
103
+ - HEAD
104
+ path: /.*
105
+
106
+ networkSecurity:
107
+ enabled: true
108
+ # allowNamespaceInternal: true
109
+ ingress: []
110
+ # - namespace: my-namespace
111
+ # podLabelsSelector:
112
+ # app: my-app
113
+
114
+ bindings:
115
+ defaultProperties:
116
+ credentialsRotationPolicy:
117
+ enabled: false
118
+ rotationFrequency: "720h"
119
+ rotatedBindingTTL: "24h"
93
120
 
94
- # bindings:
95
121
  # ui5-repo-servicerepo:
96
122
  # serviceInstanceName: ui5-repo-instance
97
123
  # externalName: ui5-kyma-binding
@@ -103,7 +129,7 @@ expose:
103
129
  # key: test
104
130
  # name: test
105
131
  # credentialsRotationPolicy:
106
- # enabled: true
132
+ # enabled: false
107
133
  # hana:
108
134
  # serviceInstanceName: hana-manual
109
135
  # portal:
@@ -39,11 +39,10 @@ module.exports = class Html5RepoTemplate extends require('../templateBase') {
39
39
  let isIndependentCommand = false
40
40
  if(Object.keys(context).length == 0){
41
41
  isIndependentCommand = true
42
- context.projectPath = this.projectPath
43
- context.oldTrackingData = context.newTrackingData = await parseMd5File(join(this.projectPath, 'chart', '.cds-add-helm-files.md5'))
42
+ context.oldTrackingData = context.newTrackingData = await parseMd5File(join('chart', '.cds-add-helm-files.md5'))
44
43
  }
45
44
  await mergeYAML(
46
- join(this.projectPath, 'chart', 'values.yaml'),
45
+ join('chart', 'values.yaml'),
47
46
  {
48
47
  'html5-apps-repo-host': {
49
48
  serviceOfferingName: 'html5-apps-repo',
@@ -84,38 +83,16 @@ module.exports = class Html5RepoTemplate extends require('../templateBase') {
84
83
  isIndependentCommand = isIndependentCommand | await helmTemplate.addSubChart('content-deployment');
85
84
 
86
85
  // add dependency entry in chart.yaml
87
- await mergeYAML(
88
- join(this.projectPath, 'chart', 'Chart.yaml'),
89
- join(__dirname, 'files', 'html5-apps-deployer.yaml'),
90
- projectDescriptor,
91
- { additions: [{
92
- in: `dependencies`,
93
- where: [{
94
- property: 'alias',
95
- isEqualTo: 'html5-apps-deployer'
96
- }]
97
- }]}
98
- )
86
+ await helmTemplate.addDependency('content-deployment', 'html5-apps-deployer');
99
87
 
100
88
  // copy service-instance chart
101
89
  isIndependentCommand = isIndependentCommand | await helmTemplate.addSubChart('service-instance');
102
90
 
103
91
  // add dependency entry in chart.yaml
104
- await mergeYAML(
105
- join(this.projectPath, 'chart', 'Chart.yaml'),
106
- join(__dirname, 'files', 'html5-apps-repo-host.yaml'),
107
- projectDescriptor,
108
- { additions: [{
109
- in: `dependencies`,
110
- where: [{
111
- property: 'alias',
112
- isEqualTo: 'html5-apps-repo-host'
113
- }]
114
- }]}
115
- )
92
+ await helmTemplate.addDependency('service-instance', 'html5-apps-repo-host');
116
93
 
117
- await copyAndTrack(join(__dirname, 'files', 'html5-apps-deployer-configmap.yaml'), join(this.projectPath, 'chart', 'templates', 'html5-apps-deployer-configmap.yaml'), context)
118
- if(isIndependentCommand) await writeMd5File(join(this.projectPath, 'chart', '.cds-add-helm-files.md5'), context.newTrackingData)
94
+ await copyAndTrack(join(__dirname, 'files', 'html5-apps-deployer-configmap.yaml'), join('chart', 'templates', 'html5-apps-deployer-configmap.yaml'), context)
95
+ if(isIndependentCommand) await writeMd5File(join('chart', '.cds-add-helm-files.md5'), context.newTrackingData)
119
96
  }
120
97
  }
121
98
  }
@@ -53,7 +53,7 @@ module.exports = class JavaTemplate extends require('../templateBase') {
53
53
  }
54
54
 
55
55
  async finalize() {
56
- const relativeProjectPath = relative(this.cwd, this.projectPath);
56
+ const relativeProjectPath = relative(this.cwd, cds.root);
57
57
  if (relativeProjectPath && relativeProjectPath !== '.') {
58
58
  LOG.info(`Continue with 'cd ${relativeProjectPath}'`);
59
59
  }
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  modules:
3
3
  - name: {{cap.appName}}-srv
4
- type: {{cap.pLanguage}}
4
+ type: {{cap.language}}
5
+ path: {{& cap.srvPath}}
5
6
  requires:
6
7
  - name: {{cap.appName}}-cf-logging
7
8
 
@@ -2,12 +2,11 @@ const { join } = require('path')
2
2
  const cds = require('../../../cds')
3
3
  const { readProject } = require('../../util/projectReader')
4
4
  const { mergeJSON, mergeYAML } = require('../../util/merge')
5
- const { PROJECT_TYPE, } = require('../../constants')
5
+ const { PROJECT_TYPE } = require('../../constants')
6
6
  const { srvNode, srvJava, kibanaLogging } = require('../_merging/registry-mta')
7
7
 
8
8
  module.exports = class KibanaLoggingTemplate extends require('../templateBase') {
9
9
 
10
-
11
10
  async canRun() {
12
11
  const projectDescriptor = await readProject(this.options)
13
12
  const { hasMta, hasHelm } = projectDescriptor.cap
@@ -31,7 +30,7 @@ module.exports = class KibanaLoggingTemplate extends require('../templateBase')
31
30
  const { for: forProfile } = projectDescriptor.cap
32
31
  const cdsTemplateFile = forProfile ? 'cds.profile.package.json.hbs' : 'cds.package.json'
33
32
  const cdsTemplatePath = join(__dirname, 'files', cdsTemplateFile)
34
- await mergeJSON(join(this.projectPath, 'package.json'), cdsTemplatePath, projectDescriptor)
33
+ await mergeJSON('package.json', cdsTemplatePath, projectDescriptor)
35
34
  }
36
35
  }
37
36
  await this.runDependentMerging()
@@ -39,14 +38,12 @@ module.exports = class KibanaLoggingTemplate extends require('../templateBase')
39
38
 
40
39
  async runDependentMerging() {
41
40
  const projectDescriptor = await readProject(this.options)
42
- const { hasMta, isNodejs } = projectDescriptor.cap
41
+ const { hasMta, isNodejs, srvPath } = projectDescriptor.cap
43
42
 
44
43
  if (hasMta) {
45
- const srv = isNodejs ? srvNode : srvJava
46
-
47
- const mtaYAMLPath = join(this.projectPath, 'mta.yaml')
44
+ const srv = (isNodejs ? srvNode : srvJava)(srvPath)
48
45
  await mergeYAML(
49
- mtaYAMLPath,
46
+ 'mta.yaml',
50
47
  join(__dirname, 'files', 'mta.yaml.hbs'),
51
48
  projectDescriptor,
52
49
  {
@@ -21,7 +21,7 @@ const VSCODE_FILE_ASSOCIATIONS = {
21
21
  module.exports = class LintTemplate extends require('../templateBase') {
22
22
  constructor(generator) {
23
23
  super(generator);
24
- this.customPath = path.join(this.projectPath, ".eslint");
24
+ this.customPath = path.join(cds.root, ".eslint");
25
25
  this.docsPath = path.join(this.customPath, "docs");
26
26
  this.rulesPath = path.join(this.customPath, "rules");
27
27
  this.testsPath = path.join(this.customPath, "tests");
@@ -81,8 +81,8 @@ module.exports = class LintTemplate extends require('../templateBase') {
81
81
  }
82
82
  });
83
83
  await io.sanitizeVscodeSettings(
84
- this.projectPath,
85
- path.join(this.projectPath, ".vscode/settings.json"),
84
+ cds.root,
85
+ path.join(cds.root, ".vscode/settings.json"),
86
86
  this.lintType,
87
87
  extensions,
88
88
  this.customRuleExample
@@ -123,7 +123,7 @@ module.exports = class LintTemplate extends require('../templateBase') {
123
123
  }
124
124
 
125
125
  _checkEslint() {
126
- const eslintCmd = checks.resolveEslint(this.projectPath, '');
126
+ const eslintCmd = checks.resolveEslint(cds.root, '');
127
127
  if (!eslintCmd) {
128
128
  this.missingNpmDependencies["names"].push("eslint");
129
129
  this.missingNpmDependencies["msgs"].push("ESLint v>=7.0.0");
@@ -134,7 +134,7 @@ module.exports = class LintTemplate extends require('../templateBase') {
134
134
  _checkEslintPlugin() {
135
135
  const eslintPluginLocal = checks.resolvePlugin(
136
136
  "@sap/eslint-plugin-cds",
137
- this.projectPath
137
+ cds.root
138
138
  );
139
139
  // Require locally installed ESLint CDS plugin
140
140
  if (!eslintPluginLocal) {
@@ -155,9 +155,9 @@ module.exports = class LintTemplate extends require('../templateBase') {
155
155
  }
156
156
 
157
157
  async _addEslintPluginConfig() {
158
- let configPath = getConfigPath(this.projectPath);
158
+ let configPath = getConfigPath(cds.root);
159
159
  if (!configPath) {
160
- configPath = path.join(this.projectPath, ".eslintrc.json");
160
+ configPath = path.join(cds.root, ".eslintrc.json");
161
161
  }
162
162
  await io.sanitizeEslintConfig(configPath, this.customRuleExample);
163
163
  return;
@@ -207,7 +207,7 @@ module.exports = class LintTemplate extends require('../templateBase') {
207
207
  let doneTask = true;
208
208
  try {
209
209
  cp.execSync(task, {
210
- cwd: this.projectPath,
210
+ cwd: cds.root,
211
211
  shell: IS_WIN,
212
212
  stdio: "inherit",
213
213
  });
@@ -14,8 +14,8 @@ build-parameters:
14
14
  {{/cap.isNodejs}}
15
15
  modules:
16
16
  - name: {{cap.appName}}-srv
17
- type: {{cap.pLanguage}}
18
- path: {{& cap.srv.path}}
17
+ type: {{cap.language}}
18
+ path: {{& cap.srvPath}}
19
19
  {{#cap.isNodejs}}
20
20
  parameters:
21
21
  buildpack: nodejs_buildpack
@@ -39,3 +39,4 @@ modules:
39
39
  - name: srv-api # required by consumers of CAP services (e.g. approuter)
40
40
  properties:
41
41
  srv-url: ${default-url}
42
+ requires: []
@@ -1,5 +1,6 @@
1
1
  const { join } = require('path');
2
- const { exists } = require('../../../cds').utils
2
+ const cds = require('../../../cds')
3
+ const { exists } = cds.utils
3
4
  const { copyFiles } = require('../../util/templateUtil')
4
5
  const { readProject } = require('../../util/projectReader');
5
6
 
@@ -13,7 +14,7 @@ module.exports = class MtaTemplate extends require('../templateBase') {
13
14
  async run() {
14
15
  const projectDescriptor = await readProject()
15
16
  if (!exists('mta.yaml')) {
16
- await copyFiles(join(__dirname, 'files'), this.projectPath, projectDescriptor);
17
+ await copyFiles(join(__dirname, 'files'), cds.root, projectDescriptor);
17
18
  }
18
19
 
19
20
  // Re-applying the dependent merging part of other facets if necessary.
@@ -1,63 +1,57 @@
1
1
  ---
2
2
  modules:
3
3
  - name: {{cap.appName}}-srv
4
- type: {{cap.pLanguage}}
5
- path: {{& cap.srv.path}}
4
+ type: {{cap.language}}
5
+ path: {{& cap.srvPath}}
6
6
  requires:
7
7
  - name: {{cap.appName}}-registry
8
- {{#cap.isJava}}
9
- - name: mtx-sidecar
8
+ {{#cap.isJava}}
9
+ - name: mtx-api
10
10
  properties:
11
11
  CDS_MULTITENANCY_MTXS_ENABLED: true
12
- CDS_MULTITENANCY_SIDECAR_URL: ~{url}
13
- {{/cap.isJava}}
12
+ CDS_MULTITENANCY_SIDECAR_URL: ~{mtx-url}
13
+ {{/cap.isJava}}
14
14
  provides:
15
15
  - name: srv-api # required by consumers of CAP services (e.g. approuter)
16
16
  properties:
17
17
  srv-url: ${default-url}
18
- {{#cap.isNodejs}}
19
- - name: mtx-api # potentially required by approuter
20
- properties:
21
- mtx-url: ${default-url}
22
- {{/cap.isNodejs}}
23
18
 
24
- {{#cap.isJava}}
25
- - name: {{cap.appName}}-mtx-sidecar
19
+ - name: {{cap.appName}}-mtx
26
20
  type: nodejs
27
- path: mtx/sidecar
21
+ path: {{#cap.isNodejs}}gen/{{/cap.isNodejs}}mtx/sidecar
22
+ {{#cap.isNodejs}}
23
+ build-parameters:
24
+ builder: npm-ci
25
+ {{/cap.isNodejs}}
26
+ {{#cap.isJava}}
28
27
  build-parameters:
29
28
  builder: custom
30
29
  build-result: gen
31
30
  commands:
32
31
  - npm run build
32
+ {{/cap.isJava}}
33
33
  parameters:
34
34
  memory: 256M
35
35
  disk-quota: 512M
36
36
  provides:
37
- - name: mtx-sidecar
38
- properties:
39
- url: ${default-url}
40
- {{#cap.isJava}}
41
- - name: mtx-api # potentially required by approuter
37
+ - name: mtx-api
42
38
  properties:
43
39
  mtx-url: ${default-url}
44
- {{/cap.isJava}}
45
- {{#cap.hasXsuaa}}
40
+ {{#cap.hasXsuaa}}
46
41
  requires:
47
42
  - name: {{cap.appName}}-auth
48
- {{/cap.hasXsuaa}}
49
- {{/cap.isJava}}
43
+ {{/cap.hasXsuaa}}
50
44
 
51
45
  resources:
52
46
  - name: {{cap.appName}}-registry
53
47
  type: org.cloudfoundry.managed-service
54
48
  requires:
55
- {{#cap.isNodejs}}
49
+ {{#cap.isNodejs}}
56
50
  - name: mtx-api
57
- {{/cap.isNodejs}}
58
- {{#cap.isJava}}
51
+ {{/cap.isNodejs}}
52
+ {{#cap.isJava}}
59
53
  - name: srv-api
60
- {{/cap.isJava}}
54
+ {{/cap.isJava}}
61
55
  parameters:
62
56
  service: saas-registry
63
57
  service-plan: application
@@ -68,14 +62,14 @@ resources:
68
62
  description: A simple CAP project.
69
63
  category: 'Category'
70
64
  appUrls:
71
- {{#cap.isNodejs}}
65
+ {{#cap.isNodejs}}
72
66
  getDependencies: ~{mtx-api/mtx-url}/-/cds/saas-provisioning/dependencies
73
67
  onSubscription: ~{mtx-api/mtx-url}/-/cds/saas-provisioning/tenant/{tenantId}
74
- {{/cap.isNodejs}}
75
- {{#cap.isJava}}
68
+ {{/cap.isNodejs}}
69
+ {{#cap.isJava}}
76
70
  getDependencies: ~{srv-api/srv-url}/mt/v1.0/subscriptions/dependencies
77
71
  onSubscription: ~{srv-api/srv-url}/mt/v1.0/subscriptions/tenants/{tenantId}
78
- {{/cap.isJava}}
72
+ {{/cap.isJava}}
79
73
  onSubscriptionAsync: true
80
74
  onUnSubscriptionAsync: true
81
75
  onUpdateDependenciesAsync: true
@@ -17,4 +17,4 @@ data:
17
17
  CDS_MULTITENANCY_APPUI_TENANTSEPARATOR: "-"
18
18
  CDS_MULTITENANCY_MTXS_ENABLED: "true"
19
19
  CDS_MULTITENANCY_APPUI_URL: {{ printf "https://%s" $approuterUrl }}
20
- CDS_MULTITENANCY_SIDECAR_URL: {{ printf "https://%s" $sidecarUrl }}
20
+ CDS_MULTITENANCY_SIDECAR_URL: {{ printf "https://%s" $sidecarUrl }}
@@ -4,6 +4,10 @@
4
4
  {{- $ := merge (dict "name" "approuter" "deployment" .Values.approuter ) . }}
5
5
  {{- $approuterUrl := (include "cap.deploymentHostFull" $ )}}
6
6
 
7
+ {{- $sidecarDeployment := .Values.sidecar }}
8
+ {{- $ = merge (dict "name" "sidecar" "deployment" .Values.sidecar ) . }}
9
+ {{- $sidecarUrl := (include "cap.deploymentHostFull" $ )}}
10
+
7
11
  apiVersion: v1
8
12
  kind: ConfigMap
9
13
  metadata:
@@ -12,4 +16,4 @@ metadata:
12
16
  data:
13
17
  CDS_MULTITENANCY_APPUI_TENANTSEPARATOR: "-"
14
18
  CDS_MULTITENANCY_APPUI_URL: {{ printf "https://%s" $approuterUrl }}
15
- SUBSCRIPTION_URL: {{ printf "https://${tenant_subdomain}-%s" $approuterUrl }}
19
+ SUBSCRIPTION_URL: {{ printf "https://${tenant_subdomain}-%s" $approuterUrl }}