@sap/cds-dk 7.4.1 → 7.5.0
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/bin/activate.js +1 -1
- package/bin/add.js +6 -4
- package/bin/build.js +4 -6
- package/bin/cds.js +4 -1
- package/bin/deploy/index.js +5 -2
- package/bin/eval.js +1 -1
- package/bin/extend.js +3 -3
- package/bin/login.js +2 -2
- package/bin/logout.js +1 -1
- package/bin/pull.js +1 -1
- package/bin/push.js +2 -2
- package/bin/subscribe.js +2 -2
- package/bin/unsubscribe.js +2 -2
- package/bin/upgrade.js +2 -2
- package/bin/version.js +2 -2
- package/bin/watch.js +1 -1
- package/lib/bind/bindingUtil.js +2 -1
- package/lib/bind/cfKeyProvider.js +1 -1
- package/lib/bind/userCdsrcJsonStorageProvider.js +1 -1
- package/lib/build/buildPlugin.js +6 -12
- package/lib/build/buildTaskEngine.js +24 -19
- package/lib/build/buildTaskFactory.js +27 -33
- package/lib/build/buildTaskProvider.js +1 -1
- package/lib/build/buildTaskProviderFactory.js +26 -41
- package/lib/build/constants.js +0 -1
- package/lib/build/index.js +3 -3
- package/lib/build/plugins.js +15 -15
- package/lib/build/provider/edmxBuildPlugin.js +6 -7
- package/lib/build/provider/fiori/index.js +8 -8
- package/lib/build/provider/hana/2migration.js +12 -16
- package/lib/build/provider/hana/index.js +5 -7
- package/lib/build/provider/hana/template/package.json +1 -1
- package/lib/build/provider/internalBuildPlugin.js +0 -8
- package/lib/build/provider/internalBuildTaskProvider.js +17 -21
- package/lib/build/provider/java/index.js +2 -1
- package/lib/build/provider/mtx-extension/index.js +3 -3
- package/lib/build/provider/mtx-sidecar/index.js +2 -1
- package/lib/build/provider/nodejs/index.js +6 -5
- package/lib/compile/openapi/csdl2openapi.js +29 -15
- package/lib/compile/openapi/index.js +6 -6
- package/lib/deploy/to-hana/hana.js +2 -2
- package/lib/env/schema.js +2 -3
- package/lib/index.js +68 -28
- package/lib/init/add.js +17 -0
- package/lib/init/constants.js +5 -3
- package/lib/init/index.js +39 -25
- package/lib/init/{util/merge.js → merge.js} +32 -20
- package/lib/init/{util/mvn.js → mvn.js} +5 -5
- package/lib/init/plugin.js +85 -0
- package/lib/init/projectReader.js +145 -0
- package/lib/init/registries/mta.js +151 -0
- package/lib/init/template/{kibana → application-logging}/files/mta.yaml.hbs +3 -3
- package/lib/init/template/application-logging/index.js +49 -0
- package/lib/init/template/approuter/files/mta.yaml.hbs +11 -11
- package/lib/init/template/approuter/files/xs-app.json.hbs +2 -2
- package/lib/init/template/approuter/index.js +36 -81
- package/lib/init/template/cf-manifest/files/manifest.yml.hbs +3 -3
- package/lib/init/template/cf-manifest/files/services-manifest.yml.hbs +4 -4
- package/lib/init/template/cf-manifest/index.js +4 -4
- package/lib/init/template/connectivity/index.js +22 -35
- package/lib/init/template/data/index.js +3 -2
- package/lib/init/template/destination/files/values.yaml +9 -0
- package/lib/init/template/destination/index.js +15 -47
- package/lib/init/template/enterprise-messaging/index.js +26 -58
- package/lib/init/template/enterprise-messaging-shared/index.js +23 -39
- package/lib/init/template/extensibility/index.js +16 -30
- package/lib/init/template/file-based-messaging/index.js +7 -8
- package/lib/init/template/h2/index.js +4 -4
- package/lib/init/template/hana/files/mta.yaml.hbs +8 -8
- package/lib/init/template/hana/index.js +29 -115
- package/lib/init/template/helm/files/chart/templates/NOTES.txt +12 -0
- package/lib/init/template/helm/files/chart/templates/_deployment_helpers.tpl +82 -0
- package/lib/init/template/helm/files/chart/templates/_helpers.tpl +28 -0
- package/lib/init/template/helm/files/chart/values.root.schema.json +61 -0
- package/lib/init/template/helm/files/chart/values.schema.json +366 -0
- package/lib/init/template/helm/{subcharts → files}/web-application/Chart.yaml +1 -1
- package/lib/init/template/helm/{subcharts → files}/web-application/templates/_api.tpl +1 -1
- package/lib/init/template/helm/{subcharts → files}/web-application/values.yaml +1 -1
- package/lib/init/template/helm/index.js +84 -85
- package/lib/init/template/helm-unified-runtime/files/Chart.yaml.hbs +10 -0
- package/lib/init/template/helm-unified-runtime/files/values.yaml.hbs +26 -0
- package/lib/init/template/helm-unified-runtime/index.js +91 -0
- package/lib/init/template/helm-unified-runtime/lib/build.js +0 -0
- package/lib/init/template/helm-unified-runtime/package.json +4 -0
- package/lib/init/template/html5-repo/files/values.yaml.hbs +28 -0
- package/lib/init/template/html5-repo/index.js +23 -97
- package/lib/init/template/java/index.js +3 -3
- package/lib/init/template/lint/index.js +2 -2
- package/lib/init/template/liquibase/index.js +16 -0
- package/lib/init/template/local-messaging/index.js +7 -8
- package/lib/init/template/mta/index.js +7 -19
- package/lib/init/template/mtx/index.js +2 -2
- package/lib/init/template/multitenancy/index.js +38 -89
- package/lib/init/template/nodejs/index.js +5 -4
- package/lib/init/template/notebook/index.js +1 -1
- package/lib/init/template/notifications/index.js +16 -19
- package/lib/init/template/pipeline/index.js +1 -1
- package/lib/init/template/postgres/index.js +25 -31
- package/lib/init/template/redis-messaging/index.js +23 -27
- package/lib/init/template/sample/index.js +4 -4
- package/lib/init/template/samples/index.js +2 -2
- package/lib/init/template/sqlite/files/{package.json.hbs → package.json} +0 -2
- package/lib/init/template/sqlite/index.js +6 -10
- package/lib/init/template/tiny-sample/index.js +6 -6
- package/lib/init/template/toggles/index.js +7 -8
- package/lib/init/template/typer/index.js +6 -6
- package/lib/init/template/xsuaa/files/mta.yaml.hbs +3 -3
- package/lib/init/template/xsuaa/files/values.yaml.hbs +3 -3
- package/lib/init/template/xsuaa/index.js +27 -52
- package/lib/init/{util/template.js → template.js} +1 -1
- package/lib/{client → mtx}/activate.js +15 -11
- package/lib/{client → mtx}/auth_manager.js +5 -4
- package/lib/{client → mtx}/download_legacy.js +6 -4
- package/lib/{client → mtx}/extend.js +14 -9
- package/lib/{client → mtx}/index.js +1 -1
- package/lib/{client → mtx}/params.js +3 -1
- package/lib/{client → mtx}/pull.js +6 -4
- package/lib/{client → mtx}/push.js +10 -9
- package/lib/{client → mtx}/settings_manager.js +8 -6
- package/lib/{client → mtx}/tenant_action.js +9 -8
- package/lib/{client/helper/cf_helper.js → mtx/util/cf.js} +4 -3
- package/lib/{client/helper/dependency_helper.js → mtx/util/dependencies.js} +1 -0
- package/lib/mtx/util/errors.js +27 -0
- package/lib/mtx/util/legacy_ext.js +16 -0
- package/lib/{client/helper/url_helper.js → mtx/util/urls.js} +12 -1
- package/lib/util/fs.js +5 -1
- package/lib/util/pruneAxiosErrors.js +35 -18
- package/lib/util/write.js +1 -1
- package/npm-shrinkwrap.json +310 -270
- package/package.json +1 -1
- package/lib/client/base_command.js +0 -54
- package/lib/init/template/_merging/registry-mta.js +0 -304
- package/lib/init/template/helm/Model.d.ts +0 -53
- package/lib/init/template/kibana/files/package.json.hbs +0 -17
- package/lib/init/template/kibana/index.js +0 -54
- package/lib/init/template/templateBase.js +0 -100
- package/lib/init/util/md5.js +0 -86
- package/lib/init/util/projectReader.js +0 -94
- /package/lib/init/{util/indent.js → indent.js} +0 -0
- /package/lib/init/template/helm/{subcharts → files}/content-deployment/Chart.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/_helpers.tpl +0 -0
- /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/job.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/secret.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/service-account.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/service-binding.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/content-deployment/values.schema.json +0 -0
- /package/lib/init/template/helm/{subcharts → files}/content-deployment/values.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/service-instance/Chart.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/service-instance/templates/_helpers.tpl +0 -0
- /package/lib/init/template/helm/{subcharts → files}/service-instance/templates/serviceinstance.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/service-instance/values.schema.json +0 -0
- /package/lib/init/template/helm/{subcharts → files}/service-instance/values.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/NOTES.txt +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/_helpers.tpl +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/api-rule.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/deployment.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/network-policy.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/pod-disruption-budget.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/rbac.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/secret.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/service-account.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/service-binding.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/service.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/virtual-service.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/values.schema.json +0 -0
- /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/templates/NOTES.txt +0 -0
- /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/templates/_deployment_helpers.tpl +0 -0
- /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/templates/_helpers.tpl +0 -0
- /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/values.root.schema.json +0 -0
- /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/values.schema.json +0 -0
- /package/lib/init/template/postgres/files/{mta.yaml.hbs → mta.yml.hbs} +0 -0
- /package/lib/init/{util/xml.js → xml.js} +0 -0
- /package/lib/{client/helper/env_helper.js → mtx/util/env.js} +0 -0
- /package/lib/{client/helper/fs_helper.js → mtx/util/fs.js} +0 -0
- /package/lib/{client/helper → mtx/util}/logging.js +0 -0
- /package/lib/{client/helper → mtx/util}/question.js +0 -0
- /package/lib/{client/helper/string_helper.js → mtx/util/strings.js} +0 -0
- /package/lib/util/{cfUtil.js → cf.js} +0 -0
- /package/lib/util/{gitUtil.js → git.js} +0 -0
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
const cds = require('../../cds')
|
|
2
|
-
const { join, resolve, basename } = require('path')
|
|
3
|
-
const { fs, exists } = cds.utils
|
|
4
|
-
const { parseXml } = require('./xml')
|
|
5
|
-
const { REGEX_JAVA_VERSION } = require('../constants')
|
|
6
|
-
const DEBUG = cds.debug('cli')
|
|
7
|
-
|
|
8
|
-
module.exports = new class ProjectReader {
|
|
9
|
-
|
|
10
|
-
constructor() {
|
|
11
|
-
this.readProject = this.readProject.bind(this)
|
|
12
|
-
|
|
13
|
-
// 1. Use project name and static default values
|
|
14
|
-
this.appVersion = cds.cli.options.add?.has('java') ? '1.0.0-SNAPSHOT' : '1.0.0'
|
|
15
|
-
this.appName = this.appId = basename(cds.root)
|
|
16
|
-
this.appDescription = 'A simple CAP project.'
|
|
17
|
-
|
|
18
|
-
// 2. Use either pom.xml or package.json
|
|
19
|
-
if (exists('pom.xml')) {
|
|
20
|
-
const { artifactId = [], description = [], version = [], properties = [] } = parseXml(resolve(cds.root, 'pom.xml')) ?? {}
|
|
21
|
-
const v = version[0] === '${revision}' ? properties[0]?.revision[0] : version[0]
|
|
22
|
-
if (v && REGEX_JAVA_VERSION.test(v)) this.appVersion = v
|
|
23
|
-
if (artifactId[0]) this.appName = this.appId = artifactId[0].split(/-parent/)[0]
|
|
24
|
-
if (description[0]) this.appDescription = description[0]
|
|
25
|
-
}
|
|
26
|
-
else if (exists('package.json')) {
|
|
27
|
-
const { name, version, description } = JSON.parse(fs.readFileSync(join(cds.root, 'package.json')))
|
|
28
|
-
this.appVersion = version
|
|
29
|
-
const segments = name.trim().replace(/@/g, '').split('/').map(encodeURIComponent)
|
|
30
|
-
this.appName = segments[segments.length - 1]
|
|
31
|
-
this.appId = segments.join('.')
|
|
32
|
-
this.appDescription = description ?? this.appDescription
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// REVISIT: There should be a better (and parallelizable) API provided by cds.env
|
|
37
|
-
/**
|
|
38
|
-
* Returns cds.env using 'production' profile by default as mta deployment is executed with having production profile set.
|
|
39
|
-
*/
|
|
40
|
-
getEnv(profile = 'production') {
|
|
41
|
-
const cdsEnvVar = process.env.CDS_ENV
|
|
42
|
-
process.env.CDS_ENV = profile
|
|
43
|
-
try {
|
|
44
|
-
// REVISIT: this is invoked 5 times for cds add multitenancy
|
|
45
|
-
return cds.env.for('cds')
|
|
46
|
-
} finally {
|
|
47
|
-
cdsEnvVar ? process.env.CDS_ENV = cdsEnvVar : delete process.env.CDS_ENV
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
async readProject() {
|
|
52
|
-
const env = this.getEnv()
|
|
53
|
-
const { appVersion, appName, appId, appDescription } = this
|
|
54
|
-
DEBUG?.({ env })
|
|
55
|
-
|
|
56
|
-
const _hasFacet = template => require(`../template/${template}`).hasFacet(env)
|
|
57
|
-
const project = {
|
|
58
|
-
get profile() { return cds.cli.options?.for },
|
|
59
|
-
get language() { return exists('pom.xml') ? 'java' : 'nodejs' },
|
|
60
|
-
get srvPath() { return join(env.build.target, env.folders.srv.replace(/\/$/, '')).replace(/\\/g, '/') },
|
|
61
|
-
get archiveName() {
|
|
62
|
-
const pom = parseXml(resolve(cds.root, env.folders.srv, 'pom.xml'))
|
|
63
|
-
return (pom?.artifactId?.[0] ?? basename(cds.root)) + '-exec.' + pom?.packaging?.[0]
|
|
64
|
-
},
|
|
65
|
-
get db() {
|
|
66
|
-
const folder = env.folders.db
|
|
67
|
-
const name = folder.replace(/\/$/, '')
|
|
68
|
-
const path = join(env.build.target, name).replace(/\\/g, '/')
|
|
69
|
-
return { folder, name, path }
|
|
70
|
-
},
|
|
71
|
-
get configFile() { return exists('pom.xml') ? '.cdsrc.json' : 'package.json' },
|
|
72
|
-
get isNodejs() { return _hasFacet('nodejs') },
|
|
73
|
-
get isJava() { return _hasFacet('java') },
|
|
74
|
-
get isMultitenant() { return _hasFacet('multitenancy') },
|
|
75
|
-
get isExtensible() { return _hasFacet('extensibility') },
|
|
76
|
-
get hasHana() { return _hasFacet('hana') },
|
|
77
|
-
get hasXsuaa() { return _hasFacet('xsuaa') },
|
|
78
|
-
get hasApprouter() { return _hasFacet('approuter') },
|
|
79
|
-
get hasDestination() { return _hasFacet('destination') },
|
|
80
|
-
get hasHtml5Repo() { return _hasFacet('html5-repo') },
|
|
81
|
-
get hasMta() { return _hasFacet('mta') },
|
|
82
|
-
get hasHelm() { return _hasFacet('helm') },
|
|
83
|
-
get appPath() { return env.folders.app ?? 'app' },
|
|
84
|
-
get appVersion() { return appVersion },
|
|
85
|
-
get appName() { return appName },
|
|
86
|
-
get cleanedAppName() { return appName.replaceAll('_', '-') }, // Required when _ isn't allowed in the namespace
|
|
87
|
-
get appId() { return appId },
|
|
88
|
-
get appDescription() { return appDescription },
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
DEBUG?.({ project })
|
|
92
|
-
return project
|
|
93
|
-
}
|
|
94
|
-
}
|
|
File without changes
|
|
File without changes
|
/package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/_helpers.tpl
RENAMED
|
File without changes
|
|
File without changes
|
/package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/secret.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib/init/template/helm/{subcharts → files}/service-instance/templates/serviceinstance.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib/init/template/helm/{subcharts → files}/web-application/templates/deployment.yaml
RENAMED
|
File without changes
|
/package/lib/init/template/helm/{subcharts → files}/web-application/templates/network-policy.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib/init/template/helm/{subcharts → files}/web-application/templates/service-account.yaml
RENAMED
|
File without changes
|
/package/lib/init/template/helm/{subcharts → files}/web-application/templates/service-binding.yaml
RENAMED
|
File without changes
|
|
File without changes
|
/package/lib/init/template/helm/{subcharts → files}/web-application/templates/virtual-service.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib/init/template/{helm/chart → helm-unified-runtime/files}/values.root.schema.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|