@sap/cds-dk 8.8.0 → 8.8.2

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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,21 @@ This project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
8
  The format is based on [Keep a Changelog](https://keepachangelog.com/).
9
9
 
10
+ ## Version 8.8.2 - 2025-03-21
11
+
12
+ ### Fixed
13
+
14
+ - Bump axios to 1.8.4, fixing CVE-2025-27152
15
+
16
+ ## Version 8.8.1 - 2025-03-11
17
+
18
+ ### Fixed
19
+
20
+ - `cds init` uses latest Maven Java archetype version 3.8.0 for creating Java projects.
21
+ - `cds import` json schema now contains correct references.
22
+ - `cds init --add lint` writes complete eslint.config.mjs.
23
+ - `cds import` no longer fails with an `EXDEV` error in `docker` containers.
24
+
10
25
  ## Version 8.8.0 - 2025-03-03
11
26
 
12
27
  ### Added
@@ -139,12 +139,12 @@ module.exports = {
139
139
  as: {
140
140
  type: "string",
141
141
  description: "Converts the input file into one of these supported formats: cds, csn or json.",
142
- $ref: "#/$defs/import-options/as"
142
+ $ref: "#/$defs/importOptions/as"
143
143
  },
144
144
  from: {
145
145
  type: "string",
146
146
  description: "Imports the model from the one of the given options: edmx, openapi or asyncapi.",
147
- $ref: "#/$defs/import-options/from"
147
+ $ref: "#/$defs/importOptions/from"
148
148
  },
149
149
  force: {
150
150
  type: "boolean",
@@ -173,7 +173,7 @@ module.exports = {
173
173
  }
174
174
  }
175
175
  },
176
-
176
+
177
177
  export: {
178
178
  type: "object",
179
179
  description: "Customize cds compile settings",
@@ -191,7 +191,7 @@ module.exports = {
191
191
  merged: {
192
192
  type: "object",
193
193
  description: "properties that needs to be there when merged option is used",
194
- additionalProperties: false,
194
+ additionalProperties: false,
195
195
  properties: {
196
196
  title: {
197
197
  type: "string",
@@ -224,37 +224,24 @@ module.exports = {
224
224
  type: "object",
225
225
  description: "Parameters related to the source of event",
226
226
  default: {
227
+ region: "the region",
228
+ applicationNamespace: "the namespace",
229
+ instanceId: "the instance id"
230
+ },
231
+ additionalProperties: false,
232
+ properties: {
227
233
  region: {
228
- "description": "The regional context of the application.",
229
- "schema": {
230
- "type": "string"
231
- }
234
+ type: "string",
235
+ description: "The regional context of the application"
232
236
  },
233
237
  applicationNamespace: {
234
- "description": "The registered namespace of the application.",
235
- "schema": {
236
- "type": "string"
237
- }
238
+ type: "string",
239
+ description: "The registered namespace of the application"
238
240
  },
239
241
  instanceId: {
240
- "description": "The instance id (tenant, installation, ...) of the application.",
241
- "schema": {
242
- "type": "string"
243
- }
242
+ type: "string",
243
+ description: "The instance id (tenant, installation, ...) of the application."
244
244
  }
245
- },
246
- additionalProperties: false,
247
- region: {
248
- type: "string",
249
- description: "The regional context of the application"
250
- },
251
- applicationNamespace: {
252
- type: "string",
253
- description: "The registered namespace of the application"
254
- },
255
- instanceId: {
256
- type: "string",
257
- description: "The instance id (tenant, installation, ...) of the application."
258
245
  }
259
246
  },
260
247
  event_characteristics: {
@@ -332,7 +319,7 @@ module.exports = {
332
319
  ]
333
320
  },
334
321
 
335
- import_options: {
322
+ importOptions: {
336
323
  from: {
337
324
  oneOf: [
338
325
  {
@@ -141,11 +141,22 @@ async function isValidInputFile(inputFileLoc) {
141
141
  }
142
142
 
143
143
  async function _copyToSrvExternal(file, dst, cwd) {
144
- const dstDir = path.dirname(dst), srcDir = path.dirname(file);
144
+ const dstDir = path.dirname(dst), srcDir = path.resolve(path.dirname(file));
145
145
  if (!file.startsWith(dstDir + path.sep)) {
146
146
  await mkdirp(dstDir);
147
- const copyOrMove = srcDir === cwd || srcDir == process.cwd() ? fs.renameSync : fs.copyFileSync;
148
- await copyOrMove(file, dst);
147
+ const copyOrMove = srcDir === cwd || srcDir === process.cwd() ? fs.renameSync : fs.copyFileSync;
148
+ try {
149
+ copyOrMove(file, dst);
150
+ } catch (err) {
151
+ // cross-device link error (might happen in docker containers), fall back to copy and delete
152
+ // see cap/issues#18004
153
+ if (err.code === 'EXDEV') {
154
+ fs.copyFileSync(file, dst);
155
+ fs.unlinkSync(file);
156
+ } else {
157
+ throw err;
158
+ }
159
+ }
149
160
  return dst;
150
161
  }
151
162
  return file;
@@ -5,7 +5,7 @@ module.exports = {
5
5
  COMMAND_ADD: 'add',
6
6
 
7
7
  JAVA_LTS_VERSIONS: [17, 21],
8
- MAVEN_ARCHETYPE_VERSION: '3.7.2',
8
+ MAVEN_ARCHETYPE_VERSION: '3.8.0',
9
9
 
10
10
  OPTIONS: Object.freeze({
11
11
  COMPLETION: 'completion',
@@ -7,6 +7,7 @@ const io = require("../../../lint/io");
7
7
  const readline = require("readline");
8
8
  const { renderAndCopy } = require('../../template')
9
9
  const { LINT_DEV, LINT_GLOBAL } = require("../../constants").OPTIONS;
10
+ const { COMMAND_INIT } = require("../../constants");
10
11
  const cds = require("../../../cds");
11
12
  const { mkdirp, exists } = cds.utils;
12
13
  const IS_WIN = os.platform() === "win32";
@@ -101,6 +102,11 @@ module.exports = class LintTemplate extends require('../../plugin') {
101
102
  "names"
102
103
  ].join(" ")}`;
103
104
 
105
+ if (cds.cli.command === COMMAND_INIT) {
106
+ this._runTask(task + ' --package-lock-only');
107
+ return;
108
+ }
109
+
104
110
  if (cds.cli.options.force) {
105
111
  console.log(
106
112
  `\n\nAlmost done - installing ${this.missingNpmDependencies["names"].length} npm dependencies:\n${task}`
@@ -118,11 +124,11 @@ module.exports = class LintTemplate extends require('../../plugin') {
118
124
  console.log("\n");
119
125
  }
120
126
  });
127
+
121
128
  await this._promptInstallDependencies(task);
122
129
  }
123
130
  }
124
131
  }
125
-
126
132
  }
127
133
 
128
134
  _checkEslint() {
package/lib/lint/io.js CHANGED
@@ -1,9 +1,13 @@
1
1
  const { read, write, exists, yaml } = require('../cds').utils;
2
+ const cds = require("../cds");
3
+
2
4
  const { readJSONC } = require("../util/fs");
3
5
  const path = require("path");
4
6
  const term = require("../util/term");
5
7
  const JSONC = require('../util/jsonc');
6
8
 
9
+ const { COMMAND_INIT } = require("../init/constants");
10
+
7
11
  module.exports = {
8
12
  /**
9
13
  * Reads ESLint config contents from file
@@ -90,7 +94,7 @@ module.exports = {
90
94
  }
91
95
  }
92
96
  if (isFilePath) {
93
- await this.writeEslintConfig(configIn, logger);
97
+ await this.writeEslintConfig(configIn, cds.cli?.command === COMMAND_INIT, logger);
94
98
  }
95
99
  return configContents;
96
100
  },
@@ -215,12 +219,12 @@ module.exports = {
215
219
  * @param {*} configPath config file path to write to
216
220
  * @returns {Promise<void>}
217
221
  */
218
- async writeEslintConfig(configPath, logger = console) {
222
+ async writeEslintConfig(configPath, force = false, logger = console) {
219
223
  let configFile = path.basename(configPath);
220
224
  switch (configFile) {
221
225
  case "eslint.config.js":
222
226
  case "eslint.config.cjs":
223
- if (exists(configPath)) {
227
+ if (!force && exists(configPath)) {
224
228
  logger.log(
225
229
  `${term.warn(
226
230
  `\n\nPlease add the following to your "${configFile}":` +
@@ -252,7 +256,7 @@ module.exports = [
252
256
  }
253
257
  break;
254
258
  case "eslint.config.mjs":
255
- if (exists(configPath)) {
259
+ if (!force && exists(configPath)) {
256
260
  logger.log(
257
261
  `${term.warn(
258
262
  `\n\nPlease add the following to your "${configFile}":` +
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "8.8.0",
3
+ "version": "8.8.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@sap/cds-dk",
9
- "version": "8.8.0",
9
+ "version": "8.8.2",
10
10
  "license": "SEE LICENSE IN LICENSE",
11
11
  "dependencies": {
12
12
  "@cap-js/asyncapi": "^1.0.0",
@@ -36,14 +36,14 @@
36
36
  }
37
37
  },
38
38
  "node_modules/@cap-js/asyncapi": {
39
- "version": "1.0.2",
39
+ "version": "1.0.3",
40
40
  "license": "SEE LICENSE IN LICENSE",
41
41
  "peerDependencies": {
42
42
  "@sap/cds": ">=7.6"
43
43
  }
44
44
  },
45
45
  "node_modules/@cap-js/db-service": {
46
- "version": "1.17.2",
46
+ "version": "1.18.0",
47
47
  "license": "SEE LICENSE",
48
48
  "optional": true,
49
49
  "dependencies": {
@@ -54,7 +54,7 @@
54
54
  }
55
55
  },
56
56
  "node_modules/@cap-js/openapi": {
57
- "version": "1.2.0",
57
+ "version": "1.2.1",
58
58
  "license": "SEE LICENSE IN LICENSE",
59
59
  "dependencies": {
60
60
  "pluralize": "^8.0.0"
@@ -64,11 +64,11 @@
64
64
  }
65
65
  },
66
66
  "node_modules/@cap-js/sqlite": {
67
- "version": "1.8.0",
67
+ "version": "1.9.0",
68
68
  "license": "SEE LICENSE",
69
69
  "optional": true,
70
70
  "dependencies": {
71
- "@cap-js/db-service": "^1.17.0",
71
+ "@cap-js/db-service": "^1.18.0",
72
72
  "better-sqlite3": "^11.0.0"
73
73
  },
74
74
  "peerDependencies": {
@@ -76,7 +76,7 @@
76
76
  }
77
77
  },
78
78
  "node_modules/@eslint-community/eslint-utils": {
79
- "version": "4.4.1",
79
+ "version": "4.5.1",
80
80
  "license": "MIT",
81
81
  "dependencies": {
82
82
  "eslint-visitor-keys": "^3.4.3"
@@ -120,6 +120,13 @@
120
120
  "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
121
121
  }
122
122
  },
123
+ "node_modules/@eslint/config-helpers": {
124
+ "version": "0.1.0",
125
+ "license": "Apache-2.0",
126
+ "engines": {
127
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
128
+ }
129
+ },
123
130
  "node_modules/@eslint/core": {
124
131
  "version": "0.12.0",
125
132
  "license": "Apache-2.0",
@@ -152,7 +159,7 @@
152
159
  }
153
160
  },
154
161
  "node_modules/@eslint/js": {
155
- "version": "9.21.0",
162
+ "version": "9.22.0",
156
163
  "license": "MIT",
157
164
  "engines": {
158
165
  "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -228,7 +235,7 @@
228
235
  }
229
236
  },
230
237
  "node_modules/@sap/cds": {
231
- "version": "8.8.0",
238
+ "version": "8.8.3",
232
239
  "license": "SEE LICENSE IN LICENSE",
233
240
  "dependencies": {
234
241
  "@sap/cds-compiler": ">=5.1",
@@ -258,7 +265,7 @@
258
265
  }
259
266
  },
260
267
  "node_modules/@sap/cds-compiler": {
261
- "version": "5.8.0",
268
+ "version": "5.8.2",
262
269
  "license": "SEE LICENSE IN LICENSE",
263
270
  "dependencies": {
264
271
  "antlr4": "4.9.3"
@@ -294,7 +301,7 @@
294
301
  }
295
302
  },
296
303
  "node_modules/@sap/cds-mtxs": {
297
- "version": "2.6.0",
304
+ "version": "2.6.1",
298
305
  "license": "SEE LICENSE IN LICENSE",
299
306
  "dependencies": {
300
307
  "@sap/hdi-deploy": ">=4",
@@ -369,10 +376,10 @@
369
376
  }
370
377
  },
371
378
  "node_modules/@sap/xsenv": {
372
- "version": "5.4.0",
379
+ "version": "5.5.0",
373
380
  "license": "SEE LICENSE IN LICENSE file",
374
381
  "dependencies": {
375
- "debug": "4.3.7",
382
+ "debug": "4.4.0",
376
383
  "node-cache": "^5.1.2",
377
384
  "verror": "1.10.1"
378
385
  },
@@ -400,7 +407,7 @@
400
407
  }
401
408
  },
402
409
  "node_modules/acorn": {
403
- "version": "8.14.0",
410
+ "version": "8.14.1",
404
411
  "license": "MIT",
405
412
  "bin": {
406
413
  "acorn": "bin/acorn"
@@ -474,7 +481,7 @@
474
481
  "license": "MIT"
475
482
  },
476
483
  "node_modules/axios": {
477
- "version": "1.8.1",
484
+ "version": "1.8.4",
478
485
  "license": "MIT",
479
486
  "dependencies": {
480
487
  "follow-redirects": "^1.15.6",
@@ -506,7 +513,7 @@
506
513
  "optional": true
507
514
  },
508
515
  "node_modules/better-sqlite3": {
509
- "version": "11.8.1",
516
+ "version": "11.9.1",
510
517
  "hasInstallScript": true,
511
518
  "license": "MIT",
512
519
  "optional": true,
@@ -637,11 +644,11 @@
637
644
  }
638
645
  },
639
646
  "node_modules/call-bound": {
640
- "version": "1.0.3",
647
+ "version": "1.0.4",
641
648
  "license": "MIT",
642
649
  "dependencies": {
643
- "call-bind-apply-helpers": "^1.0.1",
644
- "get-intrinsic": "^1.2.6"
650
+ "call-bind-apply-helpers": "^1.0.2",
651
+ "get-intrinsic": "^1.3.0"
645
652
  },
646
653
  "engines": {
647
654
  "node": ">= 0.4"
@@ -756,7 +763,7 @@
756
763
  }
757
764
  },
758
765
  "node_modules/debug": {
759
- "version": "4.3.7",
766
+ "version": "4.4.0",
760
767
  "license": "MIT",
761
768
  "dependencies": {
762
769
  "ms": "^2.1.3"
@@ -919,15 +926,16 @@
919
926
  }
920
927
  },
921
928
  "node_modules/eslint": {
922
- "version": "9.21.0",
929
+ "version": "9.22.0",
923
930
  "license": "MIT",
924
931
  "dependencies": {
925
932
  "@eslint-community/eslint-utils": "^4.2.0",
926
933
  "@eslint-community/regexpp": "^4.12.1",
927
934
  "@eslint/config-array": "^0.19.2",
935
+ "@eslint/config-helpers": "^0.1.0",
928
936
  "@eslint/core": "^0.12.0",
929
937
  "@eslint/eslintrc": "^3.3.0",
930
- "@eslint/js": "9.21.0",
938
+ "@eslint/js": "9.22.0",
931
939
  "@eslint/plugin-kit": "^0.2.7",
932
940
  "@humanfs/node": "^0.16.6",
933
941
  "@humanwhocodes/module-importer": "^1.0.1",
@@ -939,7 +947,7 @@
939
947
  "cross-spawn": "^7.0.6",
940
948
  "debug": "^4.3.2",
941
949
  "escape-string-regexp": "^4.0.0",
942
- "eslint-scope": "^8.2.0",
950
+ "eslint-scope": "^8.3.0",
943
951
  "eslint-visitor-keys": "^4.2.0",
944
952
  "espree": "^10.3.0",
945
953
  "esquery": "^1.5.0",
@@ -976,7 +984,7 @@
976
984
  }
977
985
  },
978
986
  "node_modules/eslint-scope": {
979
- "version": "8.2.0",
987
+ "version": "8.3.0",
980
988
  "license": "BSD-2-Clause",
981
989
  "dependencies": {
982
990
  "esrecurse": "^4.3.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "8.8.0",
3
+ "version": "8.8.2",
4
4
  "description": "Command line client and development toolkit for the SAP Cloud Application Programming Model",
5
5
  "homepage": "https://cap.cloud.sap/",
6
6
  "keywords": [