@sap/cds-dk 8.7.0 → 8.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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,17 @@ 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.7.1 - 2024-02-04
11
+
12
+ ### Fixed
13
+
14
+ - `cds add mta` now sets `parameters.instances` explicitly to `1` in Java projects, same as for Node.js projects.
15
+ - `cds add mta` does not add the `readiness-health-check-type` and `readiness-health-check-http-endpoint` properties to the `mta.yaml` any more.
16
+ - `cds add -p` correctly parses plugin-contributed options.
17
+ - `cds watch` correctly escapes its default ignored directories on Windows.
18
+ - `cds compile` correctly uses `--service=all` as its default.
19
+ - `cds add ias` correctly writes MTX sidecar config in combination with `cds add multitenancy`.
20
+
10
21
  ## Version 8.7.0 - 2025-01-28
11
22
 
12
23
  ### Added
@@ -15,7 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
15
26
  - `cds import` now updates configuration for Java projects (in `application.yaml` etc.)
16
27
  - `cds import --config` now also accepts a string with flat key-value pairs (like `--config "credentials.destination=foo"`), which is easier to write than the current JSON string (`--config "{\"credentials\": {\"destination\": \"foo\"}}"`).
17
28
  - `cds debug` now supports Java applications, both local and remote.
18
- - `cds import` can now import an odata-V4 file with external dependencies(odata-V4 file). Dependencies has to be provided with -d/--dependencies option and must not have any external dependencies.
29
+ - `cds import` can now import an odata-V4 file with external dependencies(odata-V4 file). Dependencies has to be provided with -d/--dependencies option and must not have any external dependencies.
19
30
 
20
31
  ### Changed
21
32
 
package/bin/cds.js CHANGED
@@ -63,13 +63,18 @@ const cli = {
63
63
  if (cmd === 'add') {
64
64
  cds.cli = { command: 'add' }
65
65
  if (argv.includes('-p') || argv.includes('--package')) {
66
- const p = argv[argv.indexOf('-p') + 1] || argv[argv.indexOf('--package') + 1]
66
+ const pIndex = argv.indexOf('-p') + 1 || argv.indexOf('--package') + 1
67
+ const p = argv[pIndex]
67
68
  console.log(`running with --package, adding dependency ${p}`)
68
- await require('../lib/util/command').spawnCommand(`npm`, ['add', p], { cwd: cds.root })
69
- delete require.cache[require.resolve(path.join(cds.root,'./package.json'))]
69
+ try {
70
+ const { execSync } = require('child_process')
71
+ execSync(`npm add ${p}`, { stdio: 'inherit', cwd: cds.root })
72
+ argv.splice(pIndex - 1, 2)
73
+ return execSync(`cds add ${argv.join(' ')}`, { stdio: 'inherit', cwd: cds.root })
74
+ } catch (e) {
75
+ throw e.message
76
+ }
70
77
  }
71
- cds.env.plugins = cds.env.for('cds').plugins // reload plugin env
72
- cds.add = require('../lib/init/add')
73
78
  await cds.plugins
74
79
  for (const [, Plugin] of cds.add.registered) {
75
80
  const all = Object.entries((new Plugin).options())
@@ -217,7 +217,7 @@ async function compile_all (root='.') {
217
217
  }
218
218
 
219
219
  async function compile (models, options={}) {
220
-
220
+ options.service ??= 'all'
221
221
  if (options.all) return compile_all (models[0])
222
222
 
223
223
  const { inspect } = require('util')
package/bin/watch.js CHANGED
@@ -75,19 +75,20 @@ const fs = require ('fs')
75
75
 
76
76
  const extDefaults = 'cds,csn,csv,ts,mjs,cjs,js,json,properties,edmx,xml,env'
77
77
 
78
+ const escapedSep = sep === '\\' ? '\\\\' : sep // escape backslash for windows
78
79
  const ignoreDefaults = [
79
80
  /\.git/,
80
81
  /node_modules/,
81
82
  /_out/,
82
83
  /@types/,
83
84
  /@cds-models/,
84
- new RegExp(`app${sep}.+?${sep}webapp${sep}`),
85
- new RegExp(`app${sep}.+?${sep}dist${sep}`),
86
- new RegExp(`app${sep}.+?${sep}target${sep}`),
87
- new RegExp(`app${sep}.+?${sep}tsconfig\\.json$`),
88
- new RegExp(`app${sep}.+?${sep}.*\\.tsbuildinfo$`),
85
+ new RegExp(`app${escapedSep}.+?${escapedSep}webapp${escapedSep}`),
86
+ new RegExp(`app${escapedSep}.+?${escapedSep}dist${escapedSep}`),
87
+ new RegExp(`app${escapedSep}.+?${escapedSep}target${escapedSep}`),
88
+ new RegExp(`app${escapedSep}.+?${escapedSep}tsconfig\\.json$`),
89
+ new RegExp(`app${escapedSep}.+?${escapedSep}.*\\.tsbuildinfo$`),
89
90
  /package-lock\.json$/,
90
- new RegExp(`\\${sep}gen\\${sep}`)
91
+ new RegExp(`${escapedSep}gen${escapedSep}`)
91
92
  ]
92
93
 
93
94
  async function watch ([cwd], {
@@ -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.0',
8
+ MAVEN_ARCHETYPE_VERSION: '3.7.1',
9
9
 
10
10
  OPTIONS: Object.freeze({
11
11
  COMPLETION: 'completion',
@@ -1,5 +1,5 @@
1
1
  const { readProject } = require('../../projectReader')
2
- const { merge } = require('../../merge')
2
+ const { merge, sort } = require('../../merge')
3
3
  const { srv4, approuter, mtxSidecar4 } = require('../../registries/mta')
4
4
  const cds = require('../../../cds')
5
5
  const { read, write } = cds.utils
@@ -20,8 +20,9 @@ module.exports = class IasTemplate extends require('../../plugin') {
20
20
 
21
21
  async run() {
22
22
  const project = readProject()
23
- const { configFile } = project
23
+ const { configFile, isNodejs } = project
24
24
  await merge(__dirname, 'files/package.json.hbs').into(configFile, { project, forceOverwrite: true })
25
+ if (isNodejs) await sort('package.json', 'dependencies')
25
26
  if (project.hasMultitenancy) {
26
27
  await merge(__dirname, 'files/package.json.hbs').into('mtx/sidecar/package.json', { project, forceOverwrite: true })
27
28
  }
@@ -33,11 +34,13 @@ module.exports = class IasTemplate extends require('../../plugin') {
33
34
  const { isJava, hasMta, hasCfManifest, hasHelm, hasHelmUnifiedRuntime, hasApprouter, hasMultitenancy, srvPath } = project
34
35
 
35
36
  if (hasMultitenancy) {
36
- const conf = (await read('mtx/sidecar/package.json')).cds ?? {}
37
- if (conf.profile) delete conf.profile
38
- conf.profiles ??= conf.profile ? [conf.profile] : []
39
- if (!conf.profiles.includes('subscription-manager')) {
40
- conf.profiles.push('subscription-manager')
37
+ const conf = (await read('mtx/sidecar/package.json')) ?? {}
38
+ conf.cds ??= {}
39
+ const profile = conf.cds.profile
40
+ if (profile) delete conf.cds.profile
41
+ conf.cds.profiles ??= profile ? [profile] : []
42
+ if (!conf.cds.profiles.includes('subscription-manager')) {
43
+ conf.cds.profiles.push('subscription-manager')
41
44
  }
42
45
  await write('mtx/sidecar/package.json', conf, { spaces: 2 })
43
46
  }
@@ -21,16 +21,13 @@ modules:
21
21
  parameters:
22
22
  instances: 1
23
23
  buildpack: nodejs_buildpack
24
- readiness-health-check-type: http
25
- readiness-health-check-http-endpoint: /health
26
24
  build-parameters:
27
25
  builder: npm-ci
28
26
  {{/isNodejs}}
29
27
  {{#isJava}}
30
28
  parameters:
29
+ instances: 1
31
30
  buildpack: sap_java_buildpack_jakarta
32
- readiness-health-check-type: http
33
- readiness-health-check-http-endpoint: /actuator/health/readiness
34
31
  properties:
35
32
  SPRING_PROFILES_ACTIVE: cloud,sandbox
36
33
  JBP_CONFIG_COMPONENTS: "jres: ['com.sap.xs.java.buildpack.jre.SAPMachineJRE']"
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "8.7.0",
3
+ "version": "8.7.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@sap/cds-dk",
9
- "version": "8.7.0",
9
+ "version": "8.7.1",
10
10
  "license": "SEE LICENSE IN LICENSE",
11
11
  "dependencies": {
12
12
  "@cap-js/asyncapi": "^1.0.0",
@@ -109,10 +109,10 @@
109
109
  }
110
110
  },
111
111
  "node_modules/@eslint/config-array": {
112
- "version": "0.19.1",
112
+ "version": "0.19.2",
113
113
  "license": "Apache-2.0",
114
114
  "dependencies": {
115
- "@eslint/object-schema": "^2.1.5",
115
+ "@eslint/object-schema": "^2.1.6",
116
116
  "debug": "^4.3.1",
117
117
  "minimatch": "^3.1.2"
118
118
  },
@@ -159,7 +159,7 @@
159
159
  }
160
160
  },
161
161
  "node_modules/@eslint/object-schema": {
162
- "version": "2.1.5",
162
+ "version": "2.1.6",
163
163
  "license": "Apache-2.0",
164
164
  "engines": {
165
165
  "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -258,7 +258,7 @@
258
258
  }
259
259
  },
260
260
  "node_modules/@sap/cds-compiler": {
261
- "version": "5.7.0",
261
+ "version": "5.7.2",
262
262
  "license": "SEE LICENSE IN LICENSE",
263
263
  "dependencies": {
264
264
  "antlr4": "4.9.3"
@@ -294,7 +294,7 @@
294
294
  }
295
295
  },
296
296
  "node_modules/@sap/cds-mtxs": {
297
- "version": "2.5.0",
297
+ "version": "2.5.1",
298
298
  "license": "SEE LICENSE IN LICENSE",
299
299
  "dependencies": {
300
300
  "@sap/hdi-deploy": ">=4",
@@ -1443,7 +1443,7 @@
1443
1443
  }
1444
1444
  },
1445
1445
  "node_modules/import-fresh": {
1446
- "version": "3.3.0",
1446
+ "version": "3.3.1",
1447
1447
  "license": "MIT",
1448
1448
  "dependencies": {
1449
1449
  "parent-module": "^1.0.0",
@@ -1699,7 +1699,7 @@
1699
1699
  "license": "MIT"
1700
1700
  },
1701
1701
  "node_modules/node-abi": {
1702
- "version": "3.73.0",
1702
+ "version": "3.74.0",
1703
1703
  "license": "MIT",
1704
1704
  "optional": true,
1705
1705
  "dependencies": {
@@ -2012,7 +2012,7 @@
2012
2012
  "license": "ISC"
2013
2013
  },
2014
2014
  "node_modules/semver": {
2015
- "version": "7.6.3",
2015
+ "version": "7.7.0",
2016
2016
  "license": "ISC",
2017
2017
  "bin": {
2018
2018
  "semver": "bin/semver.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "8.7.0",
3
+ "version": "8.7.1",
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": [