@sap/cds-dk 6.8.0 → 6.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,27 @@ This project adheres to [Semantic Versioning](http://semver.org/).
7
7
 
8
8
  The format is based on [Keep a Changelog](http://keepachangelog.com/).
9
9
 
10
+ ## Version 6.8.2 - 2023-05-31
11
+
12
+ ### Changed
13
+
14
+ - `cds compile` to `openapi` now uses `@Common.Label` annotation to generate `x-sap-shortText`.
15
+ - `cds import` now removes `x-` from elements in the `@AsyncAPI.Extensions` annotation while importing AsyncAPI documents.
16
+ - `cds compile` to `openapi` now sorts the `tags` and `paths` in alphabetical order.
17
+ - The livereload feature of `cds watch` can be disabled through `cds.livereload: false` in `package.json`.
18
+
19
+ ### Fixed
20
+
21
+ - `@sap/cds-dk` 6.8.2
22
+ - `@sap/cds-mtxs` 1.8.2
23
+ - `cds add mta` adds configuration `enterprise-messaging-shared` if necessary
24
+
25
+ ## Version 6.8.1 - 2023-05-10
26
+
27
+ ### Fixed
28
+
29
+ - `cds-ts watch` no longer fails with strange compilation errors if called in combination w/ `ts-node`
30
+
10
31
  ## Version 6.8.0 - 2023-05-04
11
32
 
12
33
  ### Added
package/bin/build/all.js CHANGED
@@ -67,6 +67,10 @@ async function build([project], options = {}) {
67
67
 
68
68
  const cds = require('../../lib/cds')
69
69
  try {
70
+ if (!cds.build) {
71
+ const { CliError } = require('../../lib/client/helper/errors')
72
+ throw new CliError('This application uses @sap/cds version >= 7, which is not compatible with the installed @sap/cds-dk version 6. Either update @sap/cds-dk to version 7 or downgrade @sap/cds to version 6 instead.')
73
+ }
70
74
  if (typeof cds.build === 'function') {
71
75
  return await cds.build(options)
72
76
  }
package/bin/watch.js CHANGED
@@ -80,8 +80,8 @@ async function watch ([cwd], {
80
80
  _options: JSON.stringify(options)
81
81
  })
82
82
  if (process.env.CDS_TYPESCRIPT) {
83
- const tsNodeRegister = localOrGlobal('ts-node', 'register')
84
- env.NODE_OPTIONS = `-r ${tsNodeRegister} ` + (env.NODE_OPTIONS || '')
83
+ // Needed by ts-node/tsc to find the tsconfig.json. Same as `--project`.
84
+ env.TS_NODE_PROJECT = env.TS_NODE_PROJECT ?? cwd ?? process.cwd()
85
85
  }
86
86
 
87
87
  // allow running w/o or partial local node_modules, also add cds-dk for its sqlite
@@ -92,7 +92,7 @@ async function watch ([cwd], {
92
92
  let includes
93
93
  let liveReload //= ...
94
94
  let firstTime = true
95
- if (!/false|no/.test(options['livereload'])) {
95
+ if (!/false|no/.test(options['livereload']) && cds.env.for('cds', cwd||process.cwd()).livereload !== false) {
96
96
  ext += ',css,gif,html,jpg,png,svg'
97
97
  includes = fioriIncludes
98
98
  liveReload = new (require ('../lib/watch/livereload-server'))
@@ -194,18 +194,6 @@ function paths (dir) {
194
194
  return parts.map ((_,i,a)=> a.slice(0,n-i).join(sep)+nm).filter(p => fs.existsSync(p))
195
195
  }
196
196
 
197
- function localOrGlobal (id, pathInMod) {
198
- // require package.json to get a stable root path of the moduloe, not its main script
199
- const modPath = require.resolve (id+'/package.json', { paths:[ process.cwd(), npmGlobalModules() ] })
200
- return resolve(modPath, '..', pathInMod)
201
- }
202
-
203
- function npmGlobalModules() {
204
- try {
205
- return require ('child_process').execSync('npm root -g').toString().trim()
206
- } catch (err) { return }
207
- }
208
-
209
197
  //
210
198
  // Child process impl launched by watch
211
199
  //
@@ -264,7 +264,10 @@ module.exports.csdl2openapi = function (
264
264
  }
265
265
  description += (diagram ? getResourceDiagram(csdl, entityContainer) : '');
266
266
  let title;
267
- if (entityContainer && entityContainer[voc.Core.Description]) {
267
+ if (entityContainer && entityContainer[voc.Common.Label]) {
268
+ title = entityContainer[voc.Common.Label];
269
+ }
270
+ else if (entityContainer && entityContainer[voc.Core.Description]) {
268
271
  title = entityContainer[voc.Core.Description];
269
272
  }
270
273
  else if (containerSchema && containerSchema[voc.Core.Description]) {
@@ -474,7 +477,7 @@ module.exports.csdl2openapi = function (
474
477
  if (description) tag.description = description;
475
478
  tags.push(tag);
476
479
  })
477
- return tags;
480
+ return tags.sort(function(pre, next){return pre.name.localeCompare(next.name)});
478
481
  }
479
482
 
480
483
  /**
@@ -502,7 +505,7 @@ module.exports.csdl2openapi = function (
502
505
  }
503
506
  })
504
507
  if (resources.length > 0) pathItemBatch(paths, container);
505
- return paths;
508
+ return Object.keys(paths).sort().reduce((p, c) => (p[c] = paths[c], p), {});
506
509
  }
507
510
 
508
511
  /**
@@ -133,11 +133,11 @@ module.exports = class ParserContext {
133
133
  annotations['@AsyncAPI.' + annotationsMapping[key]] = value;
134
134
  }
135
135
  // case: unkown annotation
136
- else if (key.startsWith('x-sap-')) {
136
+ else if (key.startsWith('x-')) {
137
137
  if (!annotations['@AsyncAPI.Extensions']) {
138
138
  annotations['@AsyncAPI.Extensions'] = {};
139
139
  }
140
- annotations['@AsyncAPI.Extensions'][key] = value;
140
+ annotations['@AsyncAPI.Extensions'][key.substring(2)] = value; //removes x- from the element
141
141
  }
142
142
  }
143
143
 
@@ -16,7 +16,7 @@ module.exports = class EnterpriseMessagingSharedTemplate extends require('../tem
16
16
  }
17
17
 
18
18
  static hasFacet(env) {
19
- return env.requires?.messaging?.kind === 'enterprise-messaging-shared'
19
+ return env.requires?.messaging?.kind === 'enterprise-messaging-amqp'
20
20
  }
21
21
 
22
22
  async run() {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "6.8.0",
3
+ "version": "6.8.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@sap/cds-dk",
9
- "version": "6.8.0",
9
+ "version": "6.8.2",
10
10
  "license": "SEE LICENSE IN LICENSE",
11
11
  "dependencies": {
12
12
  "@sap/cds": "~6.8.0",
@@ -54,12 +54,12 @@
54
54
  }
55
55
  },
56
56
  "node_modules/@eslint/eslintrc": {
57
- "version": "2.0.2",
57
+ "version": "2.0.3",
58
58
  "license": "MIT",
59
59
  "dependencies": {
60
60
  "ajv": "^6.12.4",
61
61
  "debug": "^4.3.2",
62
- "espree": "^9.5.1",
62
+ "espree": "^9.5.2",
63
63
  "globals": "^13.19.0",
64
64
  "ignore": "^5.2.0",
65
65
  "import-fresh": "^3.2.1",
@@ -75,7 +75,7 @@
75
75
  }
76
76
  },
77
77
  "node_modules/@eslint/js": {
78
- "version": "8.39.0",
78
+ "version": "8.41.0",
79
79
  "license": "MIT",
80
80
  "engines": {
81
81
  "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -183,7 +183,7 @@
183
183
  }
184
184
  },
185
185
  "node_modules/@sap/cds": {
186
- "version": "6.8.1",
186
+ "version": "6.8.2",
187
187
  "license": "SEE LICENSE IN LICENSE",
188
188
  "dependencies": {
189
189
  "@sap/cds-compiler": "^3.2.0",
@@ -227,7 +227,7 @@
227
227
  }
228
228
  },
229
229
  "node_modules/@sap/cds-mtxs": {
230
- "version": "1.8.0",
230
+ "version": "1.8.2",
231
231
  "license": "SEE LICENSE IN LICENSE",
232
232
  "dependencies": {
233
233
  "@sap/hdi-deploy": "^4",
@@ -256,10 +256,10 @@
256
256
  }
257
257
  },
258
258
  "node_modules/@sap/hdi-deploy": {
259
- "version": "4.6.0",
259
+ "version": "4.6.1",
260
260
  "license": "See LICENSE file",
261
261
  "dependencies": {
262
- "@sap/hana-client": "2.16.21",
262
+ "@sap/hana-client": "2.16.26",
263
263
  "@sap/hdi": "4.4.0",
264
264
  "@sap/xsenv": "3.4.0",
265
265
  "async": "3.2.3",
@@ -273,7 +273,7 @@
273
273
  }
274
274
  },
275
275
  "node_modules/@sap/hdi-deploy/node_modules/@sap/hana-client": {
276
- "version": "2.16.21",
276
+ "version": "2.16.26",
277
277
  "hasInstallScript": true,
278
278
  "license": "SEE LICENSE IN developer-license-3_1.txt",
279
279
  "dependencies": {
@@ -1083,13 +1083,13 @@
1083
1083
  }
1084
1084
  },
1085
1085
  "node_modules/eslint": {
1086
- "version": "8.39.0",
1086
+ "version": "8.41.0",
1087
1087
  "license": "MIT",
1088
1088
  "dependencies": {
1089
1089
  "@eslint-community/eslint-utils": "^4.2.0",
1090
1090
  "@eslint-community/regexpp": "^4.4.0",
1091
- "@eslint/eslintrc": "^2.0.2",
1092
- "@eslint/js": "8.39.0",
1091
+ "@eslint/eslintrc": "^2.0.3",
1092
+ "@eslint/js": "8.41.0",
1093
1093
  "@humanwhocodes/config-array": "^0.11.8",
1094
1094
  "@humanwhocodes/module-importer": "^1.0.1",
1095
1095
  "@nodelib/fs.walk": "^1.2.8",
@@ -1100,8 +1100,8 @@
1100
1100
  "doctrine": "^3.0.0",
1101
1101
  "escape-string-regexp": "^4.0.0",
1102
1102
  "eslint-scope": "^7.2.0",
1103
- "eslint-visitor-keys": "^3.4.0",
1104
- "espree": "^9.5.1",
1103
+ "eslint-visitor-keys": "^3.4.1",
1104
+ "espree": "^9.5.2",
1105
1105
  "esquery": "^1.4.2",
1106
1106
  "esutils": "^2.0.2",
1107
1107
  "fast-deep-equal": "^3.1.3",
@@ -1109,13 +1109,12 @@
1109
1109
  "find-up": "^5.0.0",
1110
1110
  "glob-parent": "^6.0.2",
1111
1111
  "globals": "^13.19.0",
1112
- "grapheme-splitter": "^1.0.4",
1112
+ "graphemer": "^1.4.0",
1113
1113
  "ignore": "^5.2.0",
1114
1114
  "import-fresh": "^3.0.0",
1115
1115
  "imurmurhash": "^0.1.4",
1116
1116
  "is-glob": "^4.0.0",
1117
1117
  "is-path-inside": "^3.0.3",
1118
- "js-sdsl": "^4.1.4",
1119
1118
  "js-yaml": "^4.1.0",
1120
1119
  "json-stable-stringify-without-jsonify": "^1.0.1",
1121
1120
  "levn": "^0.4.1",
@@ -1152,7 +1151,7 @@
1152
1151
  }
1153
1152
  },
1154
1153
  "node_modules/eslint-visitor-keys": {
1155
- "version": "3.4.0",
1154
+ "version": "3.4.1",
1156
1155
  "license": "Apache-2.0",
1157
1156
  "engines": {
1158
1157
  "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -1162,12 +1161,12 @@
1162
1161
  }
1163
1162
  },
1164
1163
  "node_modules/espree": {
1165
- "version": "9.5.1",
1164
+ "version": "9.5.2",
1166
1165
  "license": "BSD-2-Clause",
1167
1166
  "dependencies": {
1168
1167
  "acorn": "^8.8.0",
1169
1168
  "acorn-jsx": "^5.3.2",
1170
- "eslint-visitor-keys": "^3.4.0"
1169
+ "eslint-visitor-keys": "^3.4.1"
1171
1170
  },
1172
1171
  "engines": {
1173
1172
  "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -1454,11 +1453,12 @@
1454
1453
  }
1455
1454
  },
1456
1455
  "node_modules/get-intrinsic": {
1457
- "version": "1.2.0",
1456
+ "version": "1.2.1",
1458
1457
  "license": "MIT",
1459
1458
  "dependencies": {
1460
1459
  "function-bind": "^1.1.1",
1461
1460
  "has": "^1.0.3",
1461
+ "has-proto": "^1.0.1",
1462
1462
  "has-symbols": "^1.0.3"
1463
1463
  },
1464
1464
  "funding": {
@@ -1511,8 +1511,8 @@
1511
1511
  "license": "ISC",
1512
1512
  "optional": true
1513
1513
  },
1514
- "node_modules/grapheme-splitter": {
1515
- "version": "1.0.4",
1514
+ "node_modules/graphemer": {
1515
+ "version": "1.4.0",
1516
1516
  "license": "MIT"
1517
1517
  },
1518
1518
  "node_modules/has": {
@@ -1532,6 +1532,16 @@
1532
1532
  "node": ">=8"
1533
1533
  }
1534
1534
  },
1535
+ "node_modules/has-proto": {
1536
+ "version": "1.0.1",
1537
+ "license": "MIT",
1538
+ "engines": {
1539
+ "node": ">= 0.4"
1540
+ },
1541
+ "funding": {
1542
+ "url": "https://github.com/sponsors/ljharb"
1543
+ }
1544
+ },
1535
1545
  "node_modules/has-symbols": {
1536
1546
  "version": "1.0.3",
1537
1547
  "license": "MIT",
@@ -1727,14 +1737,6 @@
1727
1737
  "version": "2.0.0",
1728
1738
  "license": "ISC"
1729
1739
  },
1730
- "node_modules/js-sdsl": {
1731
- "version": "4.4.0",
1732
- "license": "MIT",
1733
- "funding": {
1734
- "type": "opencollective",
1735
- "url": "https://opencollective.com/js-sdsl"
1736
- }
1737
- },
1738
1740
  "node_modules/js-yaml": {
1739
1741
  "version": "4.1.0",
1740
1742
  "license": "MIT",
@@ -2057,7 +2059,7 @@
2057
2059
  "optional": true
2058
2060
  },
2059
2061
  "node_modules/node-fetch": {
2060
- "version": "2.6.9",
2062
+ "version": "2.6.11",
2061
2063
  "license": "MIT",
2062
2064
  "optional": true,
2063
2065
  "dependencies": {
@@ -2515,7 +2517,7 @@
2515
2517
  "license": "ISC"
2516
2518
  },
2517
2519
  "node_modules/semver": {
2518
- "version": "7.5.0",
2520
+ "version": "7.5.1",
2519
2521
  "license": "ISC",
2520
2522
  "dependencies": {
2521
2523
  "lru-cache": "^6.0.0"
@@ -2761,7 +2763,7 @@
2761
2763
  }
2762
2764
  },
2763
2765
  "node_modules/tar": {
2764
- "version": "6.1.14",
2766
+ "version": "6.1.15",
2765
2767
  "license": "ISC",
2766
2768
  "optional": true,
2767
2769
  "dependencies": {
@@ -2986,7 +2988,7 @@
2986
2988
  }
2987
2989
  },
2988
2990
  "node_modules/yaml": {
2989
- "version": "2.2.2",
2991
+ "version": "2.3.1",
2990
2992
  "license": "ISC",
2991
2993
  "engines": {
2992
2994
  "node": ">= 14"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "6.8.0",
3
+ "version": "6.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": [