@sap/cds-dk 8.9.4 → 9.0.4

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 (100) hide show
  1. package/CHANGELOG.md +89 -2012
  2. package/LICENSE +15 -21
  3. package/bin/bind.js +1 -1
  4. package/bin/build.js +35 -37
  5. package/bin/cds.js +12 -29
  6. package/bin/compile/index.js +2 -2
  7. package/bin/debug.js +27 -7
  8. package/bin/deploy/index.js +6 -23
  9. package/bin/deploy/to-hana.js +4 -2
  10. package/bin/help.js +3 -1
  11. package/bin/init.js +1 -1
  12. package/bin/up.js +45 -12
  13. package/bin/watch.js +45 -63
  14. package/lib/bind/cf.js +2 -1
  15. package/lib/bind/k8s.js +2 -2
  16. package/lib/bind/plugin.js +1 -1
  17. package/lib/bind/shared.js +16 -25
  18. package/lib/build/buildTaskEngine.js +26 -10
  19. package/lib/build/buildTaskFactory.js +3 -2
  20. package/lib/build/buildTaskProvider.js +18 -7
  21. package/lib/build/buildTaskProviderFactory.js +35 -13
  22. package/lib/build/constants.js +4 -0
  23. package/lib/build/index.js +1 -1
  24. package/lib/build/plugin.js +89 -54
  25. package/lib/build/plugins/helm/files/subcharts/web-application/Chart.yaml +3 -1
  26. package/lib/build/plugins/helm/files/subcharts/web-application/templates/_helpers.tpl +4 -2
  27. package/lib/build/plugins/helm/files/subcharts/web-application/templates/api-rule.yaml +4 -2
  28. package/lib/build/plugins/helm/files/subcharts/web-application/templates/deployment.yaml +18 -1
  29. package/lib/build/plugins/helm/files/subcharts/web-application/templates/service-binding.yaml +0 -1
  30. package/lib/build/plugins/helm/files/subcharts/web-application/values.schema.json +34 -2
  31. package/lib/build/plugins/helm/files/subcharts/web-application/values.yaml +9 -2
  32. package/lib/build/plugins/helm/index.js +2 -1
  33. package/lib/build/plugins.js +24 -10
  34. package/lib/build/provider/edmxBuildPlugin.js +1 -11
  35. package/lib/build/provider/hana/index.js +12 -5
  36. package/lib/build/provider/hana/template/package.json +1 -1
  37. package/lib/build/provider/internalBuildPlugin.js +1 -1
  38. package/lib/build/provider/internalBuildTaskProvider.js +3 -24
  39. package/lib/build/provider/java/index.js +1 -1
  40. package/lib/build/provider/mtx-extension/index.js +3 -8
  41. package/lib/build/provider/nodejs/index.js +28 -6
  42. package/lib/build/util.js +186 -125
  43. package/lib/deploy/index.js +5 -0
  44. package/lib/deploy/to-hana/hana.js +27 -33
  45. package/lib/deploy/to-hana/hdiDeployUtil.js +2 -2
  46. package/lib/import/odata/v2parser.js +34 -3
  47. package/lib/import/openapi/importOpenAPI.js +4 -0
  48. package/lib/index.js +2 -11
  49. package/lib/init/constants.js +0 -1
  50. package/lib/init/merge.js +101 -77
  51. package/lib/init/mvn.js +3 -3
  52. package/lib/init/projectReader.js +1 -1
  53. package/lib/init/template/ams/files/mta.yaml.hbs +6 -1
  54. package/lib/init/template/ams/files/package.json.hbs +1 -1
  55. package/lib/init/template/approuter/files/mta.yaml.hbs +5 -0
  56. package/lib/init/template/cf-manifest/files/manifest.yml.hbs +1 -1
  57. package/lib/init/template/cloud-logging/files/package.json.hbs +3 -3
  58. package/lib/init/template/dynatrace/files/mta.yaml.hbs +1 -1
  59. package/lib/init/template/dynatrace/files/package.json.hbs +2 -2
  60. package/lib/init/template/dynatrace/index.js +2 -1
  61. package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +6 -0
  62. package/lib/init/template/enterprise-messaging/index.js +5 -1
  63. package/lib/init/template/extensibility/files/package.json.hbs +1 -1
  64. package/lib/init/template/hana/files/db/package.json +1 -1
  65. package/lib/init/template/hana/files/package.json.hbs +2 -4
  66. package/lib/init/template/helm/index.js +13 -22
  67. package/lib/init/template/helm-unified-runtime/index.js +2 -1
  68. package/lib/init/template/html5-repo/files/values.yaml.hbs +12 -1
  69. package/lib/init/template/html5-repo/index.js +10 -5
  70. package/lib/init/template/http/index.js +1 -1
  71. package/lib/init/template/ias/files/mta.yaml.hbs +1 -1
  72. package/lib/init/template/ias/files/sidecar.package.json.hbs +0 -7
  73. package/lib/init/template/ias/index.js +5 -4
  74. package/lib/init/template/lint/files/package.json +6 -0
  75. package/lib/init/template/lint/index.js +61 -204
  76. package/lib/init/template/mta/files/package.json +1 -1
  77. package/lib/init/template/multitenancy/files/mta.yaml.hbs +2 -2
  78. package/lib/init/template/multitenancy/files/package.json.hbs +1 -1
  79. package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +7 -4
  80. package/lib/init/template/multitenancy/index.js +3 -0
  81. package/lib/init/template/nodejs/files/package.json.hbs +5 -2
  82. package/lib/init/template/redis/files/package.json.hbs +1 -1
  83. package/lib/init/template/sqlite/files/package.json +1 -1
  84. package/lib/init/template/toggles/files/package.json.hbs +1 -1
  85. package/lib/init/template/typescript/files/package.json +1 -3
  86. package/lib/init/template/workzone-standard/index.js +2 -0
  87. package/lib/init/template/xsuaa/index.js +2 -6
  88. package/lib/lint/Linter.js +203 -331
  89. package/lib/lint/generators.js +52 -46
  90. package/lib/lint/io.js +77 -289
  91. package/lib/util/fs.js +2 -1
  92. package/lib/util/git.js +1 -1
  93. package/lib/util/glob.js +77 -0
  94. package/lib/watch/livereload-server.js +3 -4
  95. package/lib/watch/node-watch.js +3 -4
  96. package/lib/watch/watched.js +1 -1
  97. package/npm-shrinkwrap.json +59 -1232
  98. package/package.json +6 -8
  99. package/readme.md +1 -1
  100. package/lib/lint/checks.js +0 -135
@@ -67,15 +67,20 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
67
67
  if (hasMta) {
68
68
  const srv = srv4(srvPath)
69
69
  project.apps = apps
70
- const appModules = project.apps.map(app => ({
71
- in: 'modules',
72
- where: { type: 'html5', path: `${appPath}${app.app}` }
73
- }))
74
- const additions = [srv, appDeployer, html5RepoHost, ...appModules]
75
70
  const relationships = [{
76
71
  insert: [html5RepoHost, 'name'],
77
72
  into: [appDeployer, 'requires', 'name'],
78
73
  }]
74
+ const appModules = []
75
+ for (const { app } of project.apps) {
76
+ const html5App = { in: 'modules', where: { type: 'html5', path: `${appPath}${app}` } }
77
+ appModules.push(html5App)
78
+ relationships.push({
79
+ insert: [html5App],
80
+ into: [appDeployer, 'build-parameters.requires'],
81
+ })
82
+ }
83
+ const additions = [srv, appDeployer, html5RepoHost, ...appModules]
79
84
  if (hasApprouter || hasWorkzoneStandard || hasMultitenancy) {
80
85
  additions.push(html5Runtime)
81
86
  }
@@ -140,7 +140,7 @@ module.exports = class HttpTemplate extends require('../../plugin') {
140
140
  requests.push(`@server=${hostname}\n${auth}`)
141
141
  }
142
142
  varsDefined = true
143
- const headerAuth = username ? `Authorization: Basic {{username}}:{{password}}` : ''
143
+ const headerAuth = username ? `Authorization: Basic {{username}} {{password}}` : ''
144
144
  const headers = headerAuth ? `Content-Type: application/json\n${headerAuth}` : `Content-Type: application/json`
145
145
 
146
146
  service.urlPaths.forEach((urlPath) => {
@@ -31,7 +31,7 @@ modules:
31
31
  group: destinations
32
32
  properties:
33
33
  url: ~{srv-cert-url}
34
- forwardAuthCertificates: true
34
+ forwardAuthCertificates: true
35
35
  strictSSL: true
36
36
 
37
37
  - name: {{appName}}-mtx
@@ -1,12 +1,5 @@
1
1
  {
2
2
  "dependencies": {
3
3
  "@sap/xssec": "^4"
4
- },
5
- "cds": {
6
- "requires": {
7
- "auth": {
8
- "kind": "ias"
9
- }
10
- }
11
4
  }
12
5
  }
@@ -23,7 +23,6 @@ module.exports = class IasTemplate extends require('../../plugin') {
23
23
  const { configFile, isNodejs } = project
24
24
  await merge(__dirname, 'files/package.json.hbs').into(configFile, { project, forceOverwrite: true })
25
25
  if (isNodejs) await sort('package.json', 'dependencies')
26
- // if (project.isJava) await mvn.add('ias')
27
26
  }
28
27
 
29
28
  async combine() {
@@ -54,9 +53,11 @@ module.exports = class IasTemplate extends require('../../plugin') {
54
53
  if (hasApprouter) {
55
54
  additions.push(approuter)
56
55
  additions.push({ in: [approuter, 'requires'], where: { 'parameters.config.app-identifier': 'approuter' }})
57
- const srvApi = { in: [approuter, 'requires'], where: { 'name': 'srv-api' } }
58
- additions.push(srvApi)
59
- overwrites.push({ item: [srvApi, 'properties.url'], withValue: '~{srv-cert-url}' })
56
+ const approuterSrvApi = { in: [approuter, 'requires'], where: { 'name': 'srv-api' } }
57
+ additions.push(approuterSrvApi)
58
+ overwrites.push({ item: [approuterSrvApi, 'properties.url'], withValue: '~{srv-cert-url}' })
59
+ overwrites.push({ item: [approuterSrvApi, 'properties.forwardAuthCertificates'], withValue: true })
60
+ overwrites.push({ item: [approuterSrvApi, 'properties.strictSSL'], withValue: true })
60
61
  }
61
62
  if (hasMultitenancy) {
62
63
  const mtxSidecar = mtxSidecar4(isJava ? 'mtx/sidecar' : 'gen/mtx/sidecar')
@@ -0,0 +1,6 @@
1
+ {
2
+ "devDependencies": {
3
+ "@sap/eslint-plugin-cds": "^4",
4
+ "eslint": "^9"
5
+ }
6
+ }
@@ -1,18 +1,38 @@
1
- const os = require("os");
2
- const path = require("path");
3
- const cp = require("child_process");
4
- const term = require("../../../util/term");
5
- const checks = require("../../../lint/checks");
6
- const io = require("../../../lint/io");
7
- const readline = require("readline");
8
- const { renderAndCopy } = require('../../template')
9
- const { LINT_DEV, LINT_GLOBAL } = require("../../constants").OPTIONS;
10
- const { COMMAND_INIT } = require("../../constants");
11
- const cds = require("../../../cds");
12
- const { mkdirp, exists } = cds.utils;
13
- const IS_WIN = os.platform() === "win32";
1
+ const fs = require('node:fs')
2
+ const path = require('node:path')
3
+ const io = require('../../../lint/io')
4
+ const cds = require('../../../cds')
5
+ const { merge } = require('../../merge')
6
+ const { dim, bold } = require('../../../util/term')
7
+
14
8
  const VSCODE_FILE_ASSOCIATIONS = {
15
- "csv": ["csv", "csv (semicolon)", "tsv", "tab"]
9
+ csv: ['csv', 'csv (semicolon)', 'tsv', 'tab']
10
+ }
11
+
12
+ /**
13
+ * Searches for ESLint config file types (in order or precedence)
14
+ * and returns corresponding directory (usually project's root dir)
15
+ * https://eslint.org/docs/user-guide/configuring#configuration-file-formats
16
+ * @param {string} currentDir start here and search until root dir
17
+ * @returns {string} dir containing ESLint config file (empty if not exists)
18
+ */
19
+ function getConfigPath(currentDir = '.') {
20
+ let configFiles = [
21
+ 'eslint.config.js',
22
+ 'eslint.config.cjs',
23
+ 'eslint.config.mjs'
24
+ ]
25
+ let configDir = path.resolve(currentDir)
26
+ while (configDir !== path.resolve(configDir, '..')) {
27
+ for (const configFile of configFiles) {
28
+ const configPath = path.join(configDir, configFile)
29
+ if (fs.existsSync(configPath) && fs.statSync(configPath).isFile()) {
30
+ return configPath
31
+ }
32
+ }
33
+ configDir = path.join(configDir, '..')
34
+ }
35
+ return ''
16
36
  }
17
37
 
18
38
  module.exports = class LintTemplate extends require('../../plugin') {
@@ -22,204 +42,41 @@ module.exports = class LintTemplate extends require('../../plugin') {
22
42
  }
23
43
 
24
44
  constructor() {
25
- super();
26
- this.customPath = path.join(cds.root, ".eslint");
27
- this.docsPath = path.join(this.customPath, "docs");
28
- this.rulesPath = path.join(this.customPath, "rules");
29
- this.testsPath = path.join(this.customPath, "tests");
30
- this.lintType = "local";
31
- this.customRuleExample = false;
32
- this.missingNpmDependencies = { names: [], msgs: [] };
33
- this.isTest = false;
34
- }
35
-
36
- async canRun() {
37
- const { lint } = cds.cli.options
38
- if (lint) {
39
- // If custom rule example is requested, also trigger
40
- // "custom" rule type of setup
41
- if (lint.has(LINT_DEV)) {
42
- this.customRuleExample = true;
43
- }
44
- if (lint.has(LINT_GLOBAL)) {
45
- this.lintType = "global";
46
- }
47
- }
48
- return true;
45
+ super()
46
+ const customPath = path.join(cds.root, '.eslint')
47
+ this.docsPath = path.join(customPath, 'docs')
48
+ this.rulesPath = path.join(customPath, 'rules')
49
+ this.testsPath = path.join(customPath, 'tests')
49
50
  }
50
51
 
51
52
  async run() {
52
- // Require ESLint v>=8.0.0
53
- if (!this.isTest) {
54
- this._checkEslint();
55
- }
56
-
57
- // To enable custom lint rules ('lint' or 'lint:dev')
58
- if (this.lintType === "local") {
59
- // Require local ESLint plugin installation and corresponding config
60
- this._checkEslintPlugin();
61
- await this._addEslintPluginConfig();
62
- // Include custom lint sample rule and test ('lint:dev')
63
- if (this.customRuleExample) {
64
- // Generate custom lint rules dirs
65
- await this._generateEslintDirs();
66
-
67
- if (!exists(".eslint/rules/no-entity-moo.js")) {
68
- await renderAndCopy(".eslint/rules", this.rulesPath);
69
- }
70
- if (!exists(".eslint/tests/no-entity-moo.test.js")) {
71
- await renderAndCopy(".eslint/tests", this.testsPath);
53
+ // Require local ESLint plugin installation and corresponding config
54
+ await this.#addEslintPluginConfig()
55
+
56
+ // Generate VS Code extension settings
57
+ const ALLOWED_FILE_EXTENSIONS = ['*.cds', '*.csn', '*.csv']
58
+ const extensions = new Set(ALLOWED_FILE_EXTENSIONS.map((ext) => path.extname(ext).replace('.', '')))
59
+ for (const ext of extensions) {
60
+ if (ext in VSCODE_FILE_ASSOCIATIONS) {
61
+ for (const assoc of VSCODE_FILE_ASSOCIATIONS[ext]) {
62
+ extensions.add(assoc)
72
63
  }
73
64
  }
74
-
75
- // Generate VS Code extension settings
76
- const { getFileExtensions } = require("@sap/eslint-plugin-cds/lib/api");
77
- const ALLOWED_FILE_EXTENSIONS = getFileExtensions();
78
- const extensions = new Set(ALLOWED_FILE_EXTENSIONS.map((ext) => {
79
- return path.extname(ext).replace('.', '');
80
- }))
81
- extensions.forEach((ext) => {
82
- if (ext in VSCODE_FILE_ASSOCIATIONS) {
83
- VSCODE_FILE_ASSOCIATIONS[ext].forEach((assoc) => {
84
- extensions.add(assoc)
85
- })
86
- }
87
- });
88
- await io.sanitizeVscodeSettings(
89
- path.join(cds.root, ".vscode/settings.json"),
90
- this.lintType,
91
- Array.from(extensions),
92
- this.customRuleExample
93
- );
94
65
  }
66
+ await io.sanitizeVscodeSettings(
67
+ path.join(cds.root, '.vscode/settings.json'),
68
+ Array.from(extensions),
69
+ this.customRuleExample
70
+ )
95
71
 
96
- }
97
-
98
- async finalize() {
99
- if (this.lintType !== "global") {
100
- if (this.missingNpmDependencies["names"].length > 0) {
101
- const task = `npm install --save-dev ${this.missingNpmDependencies[
102
- "names"
103
- ].join(" ")}`;
104
-
105
- if (cds.cli.command === COMMAND_INIT) {
106
- this._runTask(task + ' --package-lock-only');
107
- return;
108
- }
109
-
110
- if (cds.cli.options.force) {
111
- console.log(
112
- `\n\nAlmost done - installing ${this.missingNpmDependencies["names"].length} npm dependencies:\n${task}`
113
- );
114
- this._runTask(task);
115
- } else {
116
- console.log(
117
- `\n\nAlmost done - ${term.warn(
118
- `you are missing ${this.missingNpmDependencies["names"].length} npm dependencies`
119
- )}:\n`
120
- );
121
- this.missingNpmDependencies["msgs"].forEach((msg, i) => {
122
- console.log(`(${i + 1}) ${msg}`);
123
- if (i === this.missingNpmDependencies["msgs"].length - 1) {
124
- console.log("\n");
125
- }
126
- });
72
+ await merge(path.join(__dirname, 'files', 'package.json')).into('package.json')
127
73
 
128
- await this._promptInstallDependencies(task);
129
- }
130
- }
131
- }
74
+ console.log('\n', dim('Make sure to also run ' + bold('npm i') + dim(' to install the newly added dependencies.')))
132
75
  }
133
76
 
134
- _checkEslint() {
135
- const eslintCmd = checks.resolveEslint(cds.root, '');
136
- if (!eslintCmd) {
137
- this.missingNpmDependencies["names"].push("eslint@^9");
138
- this.missingNpmDependencies["msgs"].push("ESLint v>=9.0.0");
139
- }
140
- return;
77
+ async #addEslintPluginConfig() {
78
+ const configPath = getConfigPath(cds.root)
79
+ ?? path.join(cds.root, 'eslint.config.mjs')
80
+ await io.sanitizeEslintConfig(configPath)
141
81
  }
142
-
143
- _checkEslintPlugin() {
144
- const eslintPluginLocal = checks.resolvePlugin(
145
- "@sap/eslint-plugin-cds",
146
- cds.root
147
- );
148
-
149
- // Require locally installed ESLint CDS plugin
150
- if (!eslintPluginLocal) {
151
- this.missingNpmDependencies["names"].push("@sap/eslint-plugin-cds@^3");
152
- this.missingNpmDependencies["msgs"].push("ESLint plugin for CDS v>=3.0.0");
153
- }
154
- return;
155
- }
156
-
157
- async _generateEslintDirs() {
158
- await mkdirp(this.docsPath);
159
- await mkdirp(this.rulesPath);
160
- await mkdirp(this.testsPath);
161
- }
162
-
163
- async _addEslintPluginConfig() {
164
- const { getConfigPath } = require("@sap/eslint-plugin-cds/lib/api");
165
- let configPath = getConfigPath(cds.root);
166
- if (!configPath) {
167
- configPath = path.join(cds.root, "eslint.config.mjs");
168
- }
169
- await io.sanitizeEslintConfig(configPath, this.customRuleExample);
170
- }
171
-
172
- async _promptInstallDependencies(task) {
173
- if (!process.stdin.isTTY) {
174
- return; // non-interactive shell, like in tests
175
- }
176
- const rl = readline.createInterface({
177
- input: process.stdin,
178
- output: process.stdout,
179
- });
180
- // Do not install dependencies by default
181
- let received = "no";
182
- const timerID = setTimeout(() => {
183
- rl.write("no" + os.EOL);
184
- }, 10000);
185
- // Ask user whether dependencies should be installed
186
- const question = `${term.warn("Install dependencies now")} ? [y/n] `;
187
- let todos = `${term.error(
188
- "Aborted!\nPlease install the following components manually:"
189
- )}\n\n${term.warn(task)}`;
190
- return new Promise((resolve, reject) => {
191
- rl.question(question, (answer) => {
192
- rl.close();
193
- clearTimeout(timerID);
194
- received = answer.trim().toLowerCase();
195
- // If user confirms or force flag is set, install dependencies
196
- if (["y", "yes"].includes(received) || cds.cli.options.force) {
197
- resolve(this._runTask(task));
198
- // If use declines or question timeout is reached, print todos
199
- } else if (["n", "no"].includes(received.toLowerCase())) {
200
- console.log(todos);
201
- resolve();
202
- } else {
203
- // Close and restart question (with new timeout)
204
- rl.close();
205
- clearTimeout(timerID);
206
- this._promptInstallDependencies(task).then(resolve).catch(reject);
207
- }
208
- });
209
- })
210
- }
211
-
212
- _runTask(task) {
213
- let doneTask = true;
214
- try {
215
- cp.execSync(task, {
216
- cwd: cds.root,
217
- shell: IS_WIN,
218
- stdio: "inherit",
219
- });
220
- } catch (err) {
221
- doneTask = false;
222
- }
223
- return doneTask;
224
- }
225
- };
82
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "devDependencies": {
3
- "@sap/cds-dk": "^8"
3
+ "@sap/cds-dk": ">=8"
4
4
  }
5
5
  }
@@ -104,6 +104,6 @@ resources:
104
104
  iasServiceInstanceName: {{appName}}-auth{{#hasXsuaa}}
105
105
  saasManagerServiceInstanceName: {{appName}}-registry{{/hasXsuaa}}
106
106
  requires:
107
- - name: mtx-api
108
- {{#hasXsuaa}}processed-after: [{{appName}}-registry, {{appName}}-auth]{{/hasXsuaa}}
107
+ - name: {{#isJava}}srv-api{{/isJava}}{{^isJava}}mtx-api{{/isJava}}
108
+ processed-after: [{{#hasXsuaa}}{{appName}}-registry, {{/hasXsuaa}}{{appName}}-auth]
109
109
  {{/hasIas}}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  {{#isNodejs}}
3
3
  "dependencies": {
4
- "@sap/cds-mtxs": "^2"
4
+ "@sap/cds-mtxs": "^3"
5
5
  },
6
6
  "cds": {
7
7
  {{/isNodejs}}
@@ -1,14 +1,17 @@
1
1
  {
2
2
  "name": "{{appName}}-mtx",
3
3
  "dependencies": {
4
- "@cap-js/hana": "^1",
5
- "@sap/cds": "^8",
6
- "@sap/cds-mtxs": "^2",
4
+ "@cap-js/hana": "^2",
5
+ "@sap/cds": "^9",
6
+ "@sap/cds-mtxs": "^3",
7
7
  "@sap/xssec": "^4",
8
8
  "express": "^4"
9
9
  },
10
10
  "devDependencies": {
11
- "@cap-js/sqlite": "^1"
11
+ "@cap-js/sqlite": "^2"
12
+ },
13
+ "engines": {
14
+ "node": "^22"
12
15
  },
13
16
  "scripts": {
14
17
  "start": "cds-serve"{{#isJava}},
@@ -27,11 +27,14 @@ module.exports = class MultitenancyTemplate extends require('../../plugin') {
27
27
  async run() {
28
28
  const project = readProject()
29
29
  const { isNodejs, isJava, configFile } = project
30
+ project.profile ??= 'production'
30
31
  await merge(__dirname, 'files/package.json.hbs').into(configFile, { with: project })
31
32
  if (isJava) {
32
33
  const packageJson = await read('package.json')
33
34
  packageJson.workspaces = ['mtx/sidecar']
35
+ packageJson.devDependencies['@sap/cds-mtxs'] ??= '^3'
34
36
  await write('package.json', packageJson, { spaces: 2 })
37
+ await sort('package.json', 'devDependencies')
35
38
  await mvn.add('mtx')
36
39
  }
37
40
  if (isNodejs) await sort('package.json', 'dependencies')
@@ -6,11 +6,14 @@
6
6
  "license": "UNLICENSED",
7
7
  "private": true,
8
8
  "dependencies": {
9
- "@sap/cds": "^8",
9
+ "@sap/cds": "^9",
10
10
  "express": "^4"
11
11
  },
12
+ "engines": {
13
+ "node": "^22"
14
+ },
12
15
  "devDependencies": {
13
- "@cap-js/sqlite": "^1",
16
+ "@cap-js/sqlite": "^2",
14
17
  "@cap-js/cds-types": "^0.10.0"
15
18
  },
16
19
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "dependencies": {
3
- "redis": "^4"
3
+ "redis": "^5.0.0"
4
4
  }
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "devDependencies": {
3
- "@cap-js/sqlite": "^1"
3
+ "@cap-js/sqlite": "^2"
4
4
  }
5
5
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  {{#isNodejs}}
3
3
  "dependencies": {
4
- "@sap/cds-mtxs": "^2"
4
+ "@sap/cds-mtxs": "^3"
5
5
  },
6
6
  "cds": {
7
7
  {{/isNodejs}}
@@ -2,9 +2,7 @@
2
2
  "devDependencies": {
3
3
  "@cap-js/cds-types": "^0.10.0",
4
4
  "@types/node": "^22.0.0",
5
+ "tsx": "^4",
5
6
  "typescript": "^5"
6
- },
7
- "scripts": {
8
- "watch": "cds-tsx w"
9
7
  }
10
8
  }
@@ -59,6 +59,8 @@ module.exports = class extends require('../../plugin') {
59
59
 
60
60
  if (hasMultitenancy) {
61
61
  const mtxPackageJson = await read('mtx/sidecar/package.json')
62
+ mtxPackageJson.cds ??= {}
63
+ mtxPackageJson.cds.requires ??= {}
62
64
  mtxPackageJson.cds.requires['html5-host'] = true
63
65
  delete mtxPackageJson.cds.requires['html5-repo']
64
66
  // delete mtxPackageJson.cds.requires['html5-runtime']
@@ -27,6 +27,7 @@ module.exports = class XsuaaTemplate extends require('../../plugin') {
27
27
  const project = readProject()
28
28
  const { configFile } = project
29
29
  project.shortcut = typeof (await read(configFile)).cds?.requires?.auth !== 'object'
30
+ project.profile ??= 'production'
30
31
  await merge(__dirname, 'files/package.json.hbs').into(configFile, { project, forceOverwrite: true })
31
32
  }
32
33
 
@@ -66,12 +67,7 @@ module.exports = class XsuaaTemplate extends require('../../plugin') {
66
67
  }
67
68
 
68
69
  if (hasHelm || hasHelmUnifiedRuntime) {
69
- const overwrites = hasMultitenancy ? [{
70
- item: [{
71
- in: 'xsuaa',
72
- where: { serviceOfferingName: 'xsuaa' }
73
- }, 'parameters.tenant-mode'], withValue: 'shared'
74
- }] : []
70
+ const overwrites = hasMultitenancy ? [{ item: 'xsuaa.parameters.tenant-mode', withValue: 'shared' }] : []
75
71
  await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml', { with: project, overwrites })
76
72
  await merge({
77
73
  xsuaa: {