@sap/cds-dk 6.3.2 → 6.4.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 +38 -7
- package/bin/cds.js +2 -0
- package/bin/compile/index.js +2 -1
- package/bin/deploy/index.js +5 -3
- package/bin/deploy/to-sqlite.js +17 -15
- package/bin/help.js +7 -4
- package/bin/init.js +1 -1
- package/bin/login.js +3 -4
- package/bin/migrate.js +33 -0
- package/bin/pull.js +4 -4
- package/bin/push.js +1 -1
- package/bin/subscribe.js +58 -66
- package/bin/unsubscribe.js +67 -0
- package/bin/watch.js +4 -3
- package/lib/bind/bindingUtil.js +2 -0
- package/lib/bind/cfKeyProvider.js +5 -1
- package/lib/client/activate.js +3 -3
- package/lib/client/auth_manager.js +2 -2
- package/lib/client/base_command.js +7 -6
- package/lib/client/extend.js +2 -2
- package/lib/client/helper/errors.js +8 -2
- package/lib/client/helper/logging.js +13 -11
- package/lib/client/params.js +3 -0
- package/lib/client/pull.js +1 -1
- package/lib/client/push.js +4 -4
- package/lib/client/settings_manager.js +13 -6
- package/lib/client/subscription.js +81 -0
- package/lib/compile/to-xsuaa.js +25 -19
- package/lib/import/odata/metadataconverter/MetadataConverter.js +3 -3
- package/lib/import/odata/v2parser.js +37 -24
- package/lib/import/odata/v4parser.js +111 -37
- package/lib/init/constants.js +1 -1
- package/lib/init/index.js +2 -2
- package/lib/init/template/_merging/registry-mta.js +0 -3
- package/lib/init/template/approuter/files/approuter-configmap.yaml +10 -0
- package/lib/init/template/approuter/files/approuter-mtxs-configmap.yaml +15 -0
- package/lib/init/template/approuter/files/chart.yaml +4 -0
- package/lib/init/template/approuter/files/package.json +1 -1
- package/lib/init/template/approuter/files/values.yaml.hbs +31 -0
- package/lib/init/template/approuter/index.js +60 -12
- package/lib/init/template/auditlog/index.js +16 -8
- package/lib/init/template/cf-manifest/index.js +3 -3
- package/lib/init/template/connectivity/index.js +19 -10
- package/lib/init/template/destinations/index.js +23 -7
- package/lib/init/template/enterprise-messaging/files/cds.package.json +1 -2
- package/lib/init/template/enterprise-messaging/files/cds.profile.package.json.hbs +1 -2
- package/lib/init/template/enterprise-messaging/files/cdsrc.json +1 -2
- package/lib/init/template/enterprise-messaging/files/cdsrc.json.hbs +1 -2
- package/lib/init/template/enterprise-messaging/files/event-mesh.json.hbs +31 -0
- package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +1 -0
- package/lib/init/template/enterprise-messaging/index.js +26 -13
- package/lib/init/template/extensibility/index.js +19 -10
- package/lib/init/template/hana/files/mta.yaml.hbs +0 -4
- package/lib/init/template/hana/index.js +58 -22
- package/lib/init/template/helm/chart/templates/NOTES.txt +4 -3
- package/lib/init/template/helm/chart/templates/_deployment_helpers.tpl +25 -2
- package/lib/init/template/helm/chart/values.root.schema.json +5 -0
- package/lib/init/template/helm/chart/values.schema.json +27 -0
- package/lib/init/template/helm/files/values.yaml.hbs +1 -1
- package/lib/init/template/helm/index.js +25 -23
- package/lib/init/template/helm/subchart/templates/_helpers.tpl +29 -0
- package/lib/init/template/helm/subchart/templates/api-rule.yaml +5 -5
- package/lib/init/template/helm/subchart/templates/deployment.yaml +12 -9
- package/lib/init/template/helm/subchart/values.md +258 -88
- package/lib/init/template/helm/subchart/values.schema.json +96 -13
- package/lib/init/template/helm/subchart/values.yaml +6 -2
- package/lib/init/template/html5-repo/index.js +28 -11
- package/lib/init/template/java/index.js +5 -5
- package/lib/init/template/kibana-logging/index.js +5 -4
- package/lib/init/template/mta/index.js +2 -2
- package/lib/init/template/mtx/index.js +1 -1
- package/lib/init/template/multitenancy/files/chart.yaml +4 -0
- package/lib/init/template/multitenancy/files/java/mtxs-configmap.yaml +20 -0
- package/lib/init/template/multitenancy/files/java/package.json +6 -9
- package/lib/init/template/multitenancy/files/mtxs-configmap.yaml +15 -0
- package/lib/init/template/multitenancy/files/saas-registry.yaml +17 -19
- package/lib/init/template/multitenancy/files/values.yaml.hbs +47 -0
- package/lib/init/template/multitenancy/files/xs-security.json.hbs +0 -7
- package/lib/init/template/multitenancy/index.js +83 -37
- package/lib/init/template/nodejs/files/.eslintrc +26 -0
- package/lib/init/template/nodejs/files/package.json.hbs +0 -28
- package/lib/init/template/nodejs/index.js +7 -10
- package/lib/init/template/pipeline/index.js +4 -4
- package/lib/init/template/samples/index.js +5 -5
- package/lib/init/template/templateBase.js +1 -4
- package/lib/init/template/toggles/index.js +5 -5
- package/lib/init/template/xsuaa/files/values.yaml.hbs +21 -0
- package/lib/init/template/xsuaa/index.js +34 -24
- package/lib/init/util/md5Tracking.js +113 -0
- package/lib/init/util/merge.js +19 -2
- package/lib/init/util/projectReader.js +15 -12
- package/npm-shrinkwrap.json +211 -686
- package/package.json +3 -3
package/lib/init/util/merge.js
CHANGED
|
@@ -55,7 +55,7 @@ async function mergeJSON(into, from, projectDescriptor, semantics) {
|
|
|
55
55
|
return result
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
async function mergeYAML(into, from, projectDescriptor, semantics) {
|
|
58
|
+
async function mergeYAML(into, from, projectDescriptor, semantics = {}) {
|
|
59
59
|
const target =
|
|
60
60
|
typeof into === 'string' ? await readYAML(into) :
|
|
61
61
|
into instanceof YAML.Document ? into :
|
|
@@ -312,8 +312,25 @@ async function mergeYAML(into, from, projectDescriptor, semantics) {
|
|
|
312
312
|
return target
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
+
async function removeFromYAML(name, keyPaths) {
|
|
316
|
+
const yaml = await readYAML(name)
|
|
317
|
+
for (const keyPath of keyPaths) {
|
|
318
|
+
let node = yaml
|
|
319
|
+
const keys = keyPath.split('.')
|
|
320
|
+
for (const [index, key] of keys.entries()) {
|
|
321
|
+
if (index === keys.length - 1) {
|
|
322
|
+
node.delete(key)
|
|
323
|
+
} else {
|
|
324
|
+
node = node.get(key)
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
await writeYAML(name, yaml)
|
|
329
|
+
}
|
|
330
|
+
|
|
315
331
|
module.exports = {
|
|
316
332
|
sortDependencies,
|
|
317
333
|
mergeJSON,
|
|
318
|
-
mergeYAML
|
|
334
|
+
mergeYAML,
|
|
335
|
+
removeFromYAML
|
|
319
336
|
}
|
|
@@ -89,18 +89,21 @@ module.exports = class ProjectReader {
|
|
|
89
89
|
cds.env // make sure env is initialized, otherwise we cannot set it (exotic case)
|
|
90
90
|
cds.env = env
|
|
91
91
|
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
const nullLogger = { debug: () => { }, log: () => { }, warn: () => { }, error: () => { }, write: () => { } }
|
|
93
|
+
|
|
94
|
+
// no file path resolving as the directories might not exist - e.g. cds add will create the mtx/sidecar folder
|
|
95
|
+
const buildTasks = await new BuildTaskFactory(nullLogger, cds).getTasks({ root: this.projectPath, resolve: false, mta: false })
|
|
95
96
|
|
|
96
97
|
await Promise.all(buildTasks.map(async (task) => {
|
|
97
|
-
const
|
|
98
|
+
const srcPath = path.resolve(this.projectPath, task.src)
|
|
99
|
+
const srcFolder = path.basename(srcPath)
|
|
100
|
+
const relDestPath = path.join(env?.build?.target ?? "gen", task.dest || task.src)?.replace(/\\/g, '/')
|
|
98
101
|
|
|
99
102
|
switch (task.for) {
|
|
100
103
|
case BUILD_TASK_HANA:
|
|
101
104
|
// check whether we have a hana service binding defined as a hana build task is returned by default for compatibility reasons if neither hana, nor sqlite has been defined
|
|
102
105
|
if (this._hasHanaServiceBinding(env)) {
|
|
103
|
-
cap.db.push({ path: relDestPath, name:
|
|
106
|
+
cap.db.push({ path: relDestPath, name: srcFolder })
|
|
104
107
|
}
|
|
105
108
|
break
|
|
106
109
|
|
|
@@ -109,8 +112,8 @@ module.exports = class ProjectReader {
|
|
|
109
112
|
cap.pLanguage = P_LANGUAGE_JAVA
|
|
110
113
|
cap.srv = {
|
|
111
114
|
path: relDestPath,
|
|
112
|
-
name:
|
|
113
|
-
ext: await this._getJavaExtDescriptor(
|
|
115
|
+
name: srcFolder,
|
|
116
|
+
ext: await this._getJavaExtDescriptor(srcPath)
|
|
114
117
|
}
|
|
115
118
|
break
|
|
116
119
|
|
|
@@ -118,7 +121,7 @@ module.exports = class ProjectReader {
|
|
|
118
121
|
case BUILD_TASK_NODE_CF:
|
|
119
122
|
cap.srv = {
|
|
120
123
|
path: relDestPath,
|
|
121
|
-
name:
|
|
124
|
+
name: srcFolder
|
|
122
125
|
}
|
|
123
126
|
break
|
|
124
127
|
|
|
@@ -142,12 +145,12 @@ module.exports = class ProjectReader {
|
|
|
142
145
|
}
|
|
143
146
|
|
|
144
147
|
/**
|
|
145
|
-
* Determines java specific properties for the given
|
|
146
|
-
* @param {object}
|
|
148
|
+
* Determines java specific properties for the given module source path.
|
|
149
|
+
* @param {object} srcPath
|
|
147
150
|
*/
|
|
148
|
-
async _getJavaExtDescriptor(
|
|
151
|
+
async _getJavaExtDescriptor(srcPath) {
|
|
149
152
|
// by default spring-boot:repackage is used creating an executable jar archive
|
|
150
|
-
const pomJson = await this._parseXml(path.join(
|
|
153
|
+
const pomJson = await this._parseXml(path.join(srcPath, 'pom.xml'))
|
|
151
154
|
if (pomJson) {
|
|
152
155
|
const dependencies = pomJson?.project?.dependencies?.[0]?.dependency
|
|
153
156
|
const isOldJavaRuntime = [...dependencies].some(d => /com\.sap\.cloud\.servicesdk/.test(d?.groupId?.[0]))
|