@sap/cds-dk 6.8.3 → 7.0.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 +15 -7
- package/bin/add.js +29 -15
- package/bin/bind.js +49 -116
- package/bin/build.js +114 -0
- package/bin/cds.js +67 -24
- package/bin/compile/index.js +2 -2
- package/bin/deploy/index.js +46 -39
- package/bin/deploy/to-hana.js +11 -8
- package/bin/deploy/to-postgres.js +8 -2
- package/bin/deploy/to-sqlite.js +0 -1
- package/bin/env.js +75 -41
- package/bin/eval.js +3 -3
- package/bin/extend.js +17 -10
- package/bin/help.js +22 -21
- package/bin/import.js +10 -7
- package/bin/init.js +38 -17
- package/bin/login.js +69 -55
- package/bin/logout.js +12 -9
- package/bin/migrate.js +10 -4
- package/bin/pull.js +12 -5
- package/bin/push.js +24 -13
- package/bin/repl.js +1 -0
- package/bin/run.js +25 -0
- package/bin/subscribe.js +13 -8
- package/bin/unsubscribe.js +15 -8
- package/bin/upgrade.js +15 -9
- package/bin/util/log.js +24 -0
- package/bin/version.js +124 -0
- package/bin/watch.js +1 -35
- package/bin/watched.js +39 -0
- package/lib/bind/KubernetesApiAccessor.js +2 -2
- package/lib/bind/bindingManager.js +1 -1
- package/lib/bind/bindingUtil.js +0 -9
- package/lib/bind/cfKeyProvider.js +10 -72
- package/lib/bind/index.js +114 -0
- package/lib/bind/kubernetesCredentialsProvider.js +2 -2
- package/lib/bind/userCdsrcJsonStorageProvider.js +7 -44
- package/lib/build/buildTaskEngine.js +355 -0
- package/lib/build/buildTaskFactory.js +284 -0
- package/lib/build/buildTaskHandler.js +240 -0
- package/lib/build/buildTaskProvider.js +22 -0
- package/lib/build/buildTaskProviderFactory.js +182 -0
- package/lib/build/constants.js +56 -0
- package/lib/build/index.js +21 -0
- package/lib/build/provider/buildTaskHandlerEdmx.js +83 -0
- package/lib/build/provider/buildTaskHandlerFeatureToggles.js +132 -0
- package/lib/build/provider/buildTaskHandlerInternal.js +228 -0
- package/lib/build/provider/buildTaskProviderInternal.js +370 -0
- package/lib/build/provider/fiori/index.js +167 -0
- package/lib/build/provider/hana/2migration.js +179 -0
- package/lib/build/provider/hana/index.js +522 -0
- package/lib/build/provider/hana/migrationtable.js +472 -0
- package/lib/build/provider/hana/template/.hdiconfig-all +163 -0
- package/lib/build/provider/hana/template/.hdiconfig-cloud +137 -0
- package/lib/build/provider/hana/template/.hdinamespace +4 -0
- package/lib/build/provider/hana/template/package.json +12 -0
- package/lib/build/provider/hana/template/undeploy.json +5 -0
- package/lib/build/provider/java/index.js +93 -0
- package/lib/build/provider/java-cf/index.js +1 -0
- package/lib/build/provider/mtx/index.js +37 -0
- package/lib/build/provider/mtx/resourcesTarBuilder.js +94 -0
- package/lib/build/provider/mtx-extension/index.js +131 -0
- package/lib/build/provider/mtx-sidecar/index.js +138 -0
- package/lib/build/provider/node-cf/index.js +1 -0
- package/lib/build/provider/nodejs/index.js +178 -0
- package/lib/build/util.js +263 -0
- package/lib/cds.js +9 -21
- package/lib/client/auth_manager.js +39 -16
- package/lib/client/helper/dependency_helper.js +7 -6
- package/lib/client/push.js +2 -1
- package/lib/client/settings_manager.js +10 -39
- package/lib/deploy/to-hana/hana.js +273 -0
- package/lib/deploy/to-hana/hdiDeployUtil.js +68 -0
- package/lib/deploy/to-hana/mtaUtil.js +171 -0
- package/lib/import/asyncapi/importAsyncAPI.js +3 -2
- package/lib/import/asyncapi/index.js +5 -2
- package/lib/import/asyncapi/parserContext.js +67 -26
- package/lib/import/asyncapi/utils.js +34 -3
- package/lib/import/common.js +40 -30
- package/lib/import/importapi.js +36 -35
- package/lib/index.js +12 -17
- package/lib/init/constants.js +36 -71
- package/lib/init/index.js +18 -52
- package/lib/init/template/_merging/registry-mta.js +21 -3
- package/lib/init/template/approuter/files/mta.yaml.hbs +29 -29
- package/lib/init/template/approuter/files/values.yaml.hbs +5 -5
- package/lib/init/template/approuter/files/xs-app.json.hbs +8 -2
- package/lib/init/template/approuter/index.js +7 -8
- package/lib/init/template/auditlog/files/mta.yaml.hbs +5 -5
- package/lib/init/template/auditlog/files/package.json.hbs +13 -13
- package/lib/init/template/auditlog/index.js +3 -3
- package/lib/init/template/cf-manifest/files/manifest.yml.hbs +22 -22
- package/lib/init/template/cf-manifest/files/services-manifest.yml.hbs +3 -3
- package/lib/init/template/connectivity/files/mta.yaml.hbs +14 -0
- package/lib/init/template/connectivity/files/package.json.hbs +17 -0
- package/lib/init/template/connectivity/index.js +21 -4
- package/lib/init/template/data/index.js +5 -1
- package/lib/init/template/destination/files/mta.yaml.hbs +14 -0
- package/lib/init/template/destination/files/package.json.hbs +17 -0
- package/lib/init/template/{destinations → destination}/index.js +19 -13
- package/lib/init/template/enterprise-messaging/files/event-mesh.json.hbs +3 -3
- package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +5 -5
- package/lib/init/template/enterprise-messaging/files/package.json.hbs +9 -9
- package/lib/init/template/enterprise-messaging/files/xs-security.json.hbs +19 -0
- package/lib/init/template/enterprise-messaging/index.js +27 -6
- package/lib/init/template/enterprise-messaging-shared/files/event-mesh.json.hbs +3 -3
- package/lib/init/template/enterprise-messaging-shared/files/mta.yaml.hbs +5 -5
- package/lib/init/template/enterprise-messaging-shared/files/package.json.hbs +9 -9
- package/lib/init/template/enterprise-messaging-shared/index.js +4 -5
- package/lib/init/template/extensibility/files/package.json.hbs +10 -10
- package/lib/init/template/extensibility/index.js +8 -9
- package/lib/init/template/file-based-messaging/files/package.json.hbs +9 -9
- package/lib/init/template/file-based-messaging/index.js +3 -4
- package/lib/init/template/hana/files/db/package.json +1 -1
- package/lib/init/template/hana/files/mta.yaml.hbs +21 -21
- package/lib/init/template/hana/files/package.json.hbs +16 -22
- package/lib/init/template/hana/files/values.yaml.hbs +1 -1
- package/lib/init/template/hana/index.js +5 -15
- package/lib/init/template/helm/files/Chart.yaml.hbs +4 -4
- package/lib/init/template/helm/files/values.yaml.hbs +6 -6
- package/lib/init/template/helm/index.js +5 -10
- package/lib/init/template/helm/subcharts/content-deployment/Chart.yaml +2 -0
- package/lib/init/template/helm/subcharts/content-deployment/templates/_helpers.tpl +37 -31
- package/lib/init/template/helm/subcharts/content-deployment/templates/job.yaml +13 -14
- package/lib/init/template/helm/subcharts/content-deployment/templates/secret.yaml +2 -2
- package/lib/init/template/helm/subcharts/content-deployment/templates/service-account.yaml +1 -1
- package/lib/init/template/helm/subcharts/content-deployment/templates/service-binding.yaml +3 -3
- package/lib/init/template/helm/subcharts/content-deployment/values.md +116 -116
- package/lib/init/template/helm/subcharts/service-instance/Chart.yaml +2 -0
- package/lib/init/template/helm/subcharts/service-instance/templates/_helpers.tpl +9 -9
- package/lib/init/template/helm/subcharts/service-instance/templates/serviceinstance.yaml +2 -2
- package/lib/init/template/helm/subcharts/service-instance/values.md +15 -15
- package/lib/init/template/helm/subcharts/web-application/Chart.yaml +2 -0
- package/lib/init/template/helm/subcharts/web-application/templates/NOTES.txt +15 -0
- package/lib/init/template/helm/subcharts/web-application/templates/_helpers.tpl +23 -23
- package/lib/init/template/helm/subcharts/web-application/templates/api-rule.yaml +4 -4
- package/lib/init/template/helm/subcharts/web-application/templates/deployment.yaml +17 -17
- package/lib/init/template/helm/subcharts/web-application/templates/network-policy.yaml +24 -3
- package/lib/init/template/helm/subcharts/web-application/templates/pod-disruption-budget.yaml +3 -3
- package/lib/init/template/helm/subcharts/web-application/templates/secret.yaml +2 -2
- package/lib/init/template/helm/subcharts/web-application/templates/service-account.yaml +1 -1
- package/lib/init/template/helm/subcharts/web-application/templates/service-binding.yaml +3 -3
- package/lib/init/template/helm/subcharts/web-application/templates/service.yaml +3 -3
- package/lib/init/template/helm/subcharts/web-application/values.md +141 -123
- package/lib/init/template/helm/subcharts/web-application/values.schema.json +7 -0
- package/lib/init/template/helm/subcharts/web-application/values.yaml +1 -0
- package/lib/init/template/html5-repo/index.js +4 -5
- package/lib/init/template/java/index.js +5 -5
- package/lib/init/template/kibana-logging/files/mta.yaml.hbs +5 -5
- package/lib/init/template/kibana-logging/files/package.json.hbs +9 -9
- package/lib/init/template/kibana-logging/index.js +3 -4
- package/lib/init/template/lint/index.js +3 -3
- package/lib/init/template/mta/files/mta.yaml.hbs +14 -14
- package/lib/init/template/mta/files/package.json +5 -0
- package/lib/init/template/mta/index.js +12 -13
- package/lib/init/template/mtx/index.js +2 -2
- package/lib/init/template/multitenancy/files/mta.yaml.hbs +29 -27
- package/lib/init/template/multitenancy/files/package.json.hbs +17 -14
- package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +7 -7
- package/lib/init/template/multitenancy/files/values.yaml.hbs +19 -19
- package/lib/init/template/multitenancy/index.js +14 -16
- package/lib/init/template/nodejs/files/package.json.hbs +1 -1
- package/lib/init/template/nodejs/index.js +5 -8
- package/lib/init/template/redis-messaging/files/mta.yaml.hbs +5 -5
- package/lib/init/template/redis-messaging/files/package.json.hbs +9 -9
- package/lib/init/template/redis-messaging/index.js +4 -5
- package/lib/init/template/sample/files/app/_i18n/i18n.properties +43 -0
- package/lib/init/template/sample/files/app/_i18n/i18n_de.properties +14 -0
- package/lib/init/template/sample/files/app/admin-books/fiori-service.cds +114 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/Component.js +8 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n.properties +11 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +129 -0
- package/lib/init/template/sample/files/app/appconfig/fioriSandboxConfig.json +57 -0
- package/lib/init/template/sample/files/app/common.cds +263 -0
- package/lib/init/template/sample/files/app/index.html +30 -0
- package/lib/init/template/sample/files/app/services.cds +5 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Authors.csv +5 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books.csv +6 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books_texts.csv +5 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Genres.csv +16 -0
- package/lib/init/template/sample/files/db/schema.cds +31 -0
- package/lib/init/template/sample/files/nodejs/admin-service.js +12 -0
- package/lib/init/template/sample/files/nodejs/cat-service.js +26 -0
- package/lib/init/template/sample/files/srv/admin-service.cds +5 -0
- package/lib/init/template/sample/files/srv/cat-service.cds +16 -0
- package/lib/init/template/sample/index.js +24 -0
- package/lib/init/template/sample-tiny/index.js +39 -0
- package/lib/init/template/samples/index.js +5 -56
- package/lib/init/template/sqlite/files/package.json.hbs +13 -13
- package/lib/init/template/sqlite/index.js +2 -2
- package/lib/init/template/templateBase.js +24 -1
- package/lib/init/template/toggles/files/package.json.hbs +10 -10
- package/lib/init/template/toggles/index.js +3 -3
- package/lib/init/template/typer/files/gitignore +1 -0
- package/lib/init/template/typer/files/package.json +8 -0
- package/lib/init/template/typer/files/xsconfig.json +9 -0
- package/lib/init/template/typer/index.js +36 -0
- package/lib/init/template/xsuaa/files/mta.yaml.hbs +12 -12
- package/lib/init/template/xsuaa/files/package.json.hbs +13 -13
- package/lib/init/template/xsuaa/files/values.yaml.hbs +8 -8
- package/lib/init/template/xsuaa/index.js +8 -19
- package/lib/init/util/merge.js +73 -59
- package/lib/init/util/mvn.js +21 -17
- package/lib/init/util/projectReader.js +49 -87
- package/lib/init/util/xml.js +14 -23
- package/lib/util/cfUtil.js +366 -0
- package/lib/util/command.js +3 -3
- package/lib/util/gitUtil.js +55 -0
- package/lib/util/version.js +27 -0
- package/npm-shrinkwrap.json +337 -275
- package/package.json +6 -6
- package/CHANGELOG.md +0 -1460
- package/bin/build/all.js +0 -88
- package/bin/build/index.js +0 -82
- package/lib/compile/index.js +0 -14
- /package/lib/init/template/{samples → sample-tiny}/files/nodejs/db/data/my.bookshop-Books.csv +0 -0
- /package/lib/init/template/{samples → sample-tiny}/files/nodejs/db/data-model.cds +0 -0
- /package/lib/init/template/{samples → sample-tiny}/files/nodejs/srv/cat-service.cds.hbs +0 -0
package/lib/init/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const os = require('os');
|
|
2
2
|
|
|
3
|
-
const MAVEN_ARCHETYPE_VERSION = '
|
|
3
|
+
const MAVEN_ARCHETYPE_VERSION = '2.0.1';
|
|
4
4
|
|
|
5
5
|
const constants = {
|
|
6
6
|
IS_WIN: (os.platform() === 'win32'),
|
|
@@ -10,40 +10,43 @@ const constants = {
|
|
|
10
10
|
|
|
11
11
|
MAVEN_ARCHETYPE_VERSION,
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
13
|
+
OPTIONS: Object.freeze({
|
|
14
|
+
JAVA: 'java',
|
|
15
|
+
JAVA_MVN: 'java:mvn',
|
|
16
|
+
JAVA_PACKAGE: 'java:package',
|
|
17
|
+
NODEJS: 'nodejs',
|
|
18
|
+
PIPELINE: 'pipeline',
|
|
19
|
+
MTA: 'mta',
|
|
20
|
+
CONNECTIVITY: 'connectivity',
|
|
21
|
+
CF_MANIFEST: 'cf-manifest',
|
|
22
|
+
MTX: 'mtx',
|
|
23
|
+
MULTITENANCY: 'multitenancy',
|
|
24
|
+
TOGGLES: 'toggles',
|
|
25
|
+
EXTENSIBILITY: 'extensibility',
|
|
26
|
+
XSUAA: 'xsuaa',
|
|
27
|
+
HANA: 'hana',
|
|
28
|
+
SQLITE: 'sqlite',
|
|
29
|
+
AUDITLOG: 'auditlog',
|
|
30
|
+
ENTERPRISE_MESSAGING: 'enterprise-messaging',
|
|
31
|
+
ENTERPRISE_MESSAGING_SHARED: 'enterprise-messaging-shared',
|
|
32
|
+
FILE_BASED_MESSAGING: 'file-based-messaging',
|
|
33
|
+
REDIS_MESSAGING: 'redis-messaging',
|
|
34
|
+
APPROUTER: 'approuter',
|
|
35
|
+
DESTINATION: 'destination',
|
|
36
|
+
SAMPLES: 'samples', // deprecated
|
|
37
|
+
SAMPLE_TINY: 'sample-tiny',
|
|
38
|
+
SAMPLE: 'sample',
|
|
39
|
+
DATA: 'data',
|
|
40
|
+
KIBANA_LOGGING: 'kibana-logging',
|
|
41
|
+
LINT: 'lint',
|
|
42
|
+
LINT_GLOBAL: 'lint:global',
|
|
43
|
+
LINT_DEV: 'lint:dev',
|
|
44
|
+
HELM: 'helm',
|
|
45
|
+
TYPER: 'typer'
|
|
46
|
+
}),
|
|
42
47
|
|
|
43
48
|
PROJECT_TYPE: Object.freeze({ nodejs: 1, java: 2, unknown: 3 }),
|
|
44
49
|
|
|
45
|
-
PYTHON_VENV_NAME: '.cap-jupyter-nb',
|
|
46
|
-
|
|
47
50
|
REGEX_JAVA_PACKAGE: /^[a-z_][a-z0-9_]*(\.[a-z_][a-z0-9_]*)*$/g,
|
|
48
51
|
REGEX_PROJECT_NAME: /[^0-9a-zA-Z_-]/g,
|
|
49
52
|
|
|
@@ -51,52 +54,14 @@ const constants = {
|
|
|
51
54
|
PIPELINE_HELP: 'https://sap.github.io/jenkins-library/',
|
|
52
55
|
SAMPLES: 'https://github.com/SAP-samples/cloud-cap-samples',
|
|
53
56
|
CAPIRE: 'https://cap.cloud.sap',
|
|
54
|
-
JUPYTERLAB: 'https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html',
|
|
55
57
|
MAVEN_ARCHETYPE_HELP: `https://cap.cloud.sap/docs/java/development/#the-maven-archetype`,
|
|
56
58
|
MAVEN_INSTALL_HELP: `https://maven.apache.org/install.html`,
|
|
57
|
-
PYTHON: 'https://www.python.org/downloads/',
|
|
58
|
-
PYTHON_PIP: 'https://packaging.python.org/en/latest/guides/',
|
|
59
59
|
VSCODE: 'https://code.visualstudio.com/',
|
|
60
60
|
VSCODE_NBVIEWER: 'https://marketplace.visualstudio.com/items?itemName=ms-python.python',
|
|
61
61
|
VSCODE_ESLINT: 'https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint'
|
|
62
62
|
}),
|
|
63
63
|
|
|
64
|
-
PROJECT_FILES: ['package.json', 'pom.xml', '.cdsrc.json']
|
|
65
|
-
|
|
66
|
-
KIND_SQL: 'sql',
|
|
67
|
-
KIND_HANA: 'hana',
|
|
68
|
-
KIND_HANA_CLOUD: 'hana-cloud',
|
|
69
|
-
KIND_HANA_MT: 'hana-mt'
|
|
64
|
+
PROJECT_FILES: ['package.json', 'pom.xml', '.cdsrc.json']
|
|
70
65
|
}
|
|
71
66
|
|
|
72
|
-
constants.OPTIONS_PRIORITY = [
|
|
73
|
-
constants.OPTION_JAVA,
|
|
74
|
-
constants.OPTION_NODEJS,
|
|
75
|
-
constants.OPTION_PIPELINE,
|
|
76
|
-
constants.OPTION_MTA,
|
|
77
|
-
constants.OPTION_CF_MANIFEST,
|
|
78
|
-
constants.OPTION_MTX,
|
|
79
|
-
constants.OPTION_MULTITENANCY,
|
|
80
|
-
constants.OPTION_TOGGLES,
|
|
81
|
-
constants.OPTION_EXTENSIBILITY,
|
|
82
|
-
constants.OPTION_XSUAA,
|
|
83
|
-
constants.OPTION_HANA,
|
|
84
|
-
constants.OPTION_SQLITE,
|
|
85
|
-
constants.OPTION_AUDITLOG,
|
|
86
|
-
constants.OPTION_ENTERPRISE_MESSAGING,
|
|
87
|
-
constants.OPTION_ENTERPRISE_MESSAGING_SHARED,
|
|
88
|
-
constants.OPTION_FILE_BASED_MESSAGING,
|
|
89
|
-
constants.OPTION_REDIS_MESSAGING,
|
|
90
|
-
constants.OPTION_APPROUTER,
|
|
91
|
-
constants.OPTION_DESTINATIONS,
|
|
92
|
-
constants.OPTION_SAMPLES,
|
|
93
|
-
constants.OPTION_DATA,
|
|
94
|
-
constants.OPTION_KIBANA_LOGGING,
|
|
95
|
-
constants.OPTION_NOTEBOOK,
|
|
96
|
-
constants.OPTION_LINT,
|
|
97
|
-
constants.OPTION_LINT_CUSTOM,
|
|
98
|
-
constants.OPTION_LINT_EXAMPLE,
|
|
99
|
-
constants.OPTION_HELM
|
|
100
|
-
];
|
|
101
|
-
|
|
102
67
|
module.exports = constants;
|
package/lib/init/index.js
CHANGED
|
@@ -2,11 +2,8 @@ const path = require('path');
|
|
|
2
2
|
|
|
3
3
|
const term = require('../util/term');
|
|
4
4
|
|
|
5
|
-
const {
|
|
6
|
-
|
|
7
|
-
OPTION_XSUAA, OPTION_AUDITLOG, OPTION_HANA, OPTION_MTA, OPTION_MTX, OPTION_APPROUTER, OPTION_KIBANA_LOGGING,
|
|
8
|
-
OPTION_NODEJS, OPTION_JAVA, OPTION_HELM,
|
|
9
|
-
OPTION_PIPELINE, OPTION_SAMPLES, OPTION_CF_MANIFEST, PROJECT_FILES, REGEX_PROJECT_NAME } = require('./constants');
|
|
5
|
+
const { OPTIONS, COMMAND_ADD, COMMAND_INIT, PROJECT_FILES, REGEX_PROJECT_NAME } = require('./constants')
|
|
6
|
+
const { NODEJS, JAVA, HANA, MTA,PIPELINE, SAMPLES, CF_MANIFEST } = OPTIONS
|
|
10
7
|
|
|
11
8
|
const cds = require('../cds'), { exists, readdir } = cds.utils
|
|
12
9
|
const LOG = console
|
|
@@ -42,10 +39,10 @@ module.exports = class CDSGenerator {
|
|
|
42
39
|
{
|
|
43
40
|
title: `Type`,
|
|
44
41
|
description: `Select your runtime.`,
|
|
45
|
-
default:
|
|
42
|
+
default: NODEJS,
|
|
46
43
|
choices: [
|
|
47
|
-
{ name: 'Node.js', value:
|
|
48
|
-
{ name: 'Java', value:
|
|
44
|
+
{ name: 'Node.js', value: NODEJS },
|
|
45
|
+
{ name: 'Java', value: JAVA }
|
|
49
46
|
],
|
|
50
47
|
multiple: false,
|
|
51
48
|
target: 'add',
|
|
@@ -59,14 +56,13 @@ module.exports = class CDSGenerator {
|
|
|
59
56
|
description: `Add features to your project.`,
|
|
60
57
|
default: '',
|
|
61
58
|
choices: [
|
|
62
|
-
{ name: 'CI/CD Pipeline Integration', value:
|
|
63
|
-
{ name: 'Configuration for SAP HANA Deployment', value:
|
|
64
|
-
{ name: 'MTA based SAP Business Technology Platform Deployment', value:
|
|
65
|
-
// { name: 'Multitenancy', value:
|
|
66
|
-
|
|
67
|
-
{ name: `
|
|
68
|
-
// { name: `CDS Linter for custom rules`, value:
|
|
69
|
-
// { name: `CDS Linter for custom rules with sample`, value: OPTION_LINT_DEV }
|
|
59
|
+
{ name: 'CI/CD Pipeline Integration', value: PIPELINE },
|
|
60
|
+
{ name: 'Configuration for SAP HANA Deployment', value: HANA },
|
|
61
|
+
{ name: 'MTA based SAP Business Technology Platform Deployment', value: MTA },
|
|
62
|
+
// { name: 'Multitenancy', value: mtx },
|
|
63
|
+
{ name: `Cloud Foundry native Deployment`, value: CF_MANIFEST }
|
|
64
|
+
// { name: `CDS Linter for custom rules`, value: lint },
|
|
65
|
+
// { name: `CDS Linter for custom rules with sample`, value: lintDev }
|
|
70
66
|
],
|
|
71
67
|
multiple: true,
|
|
72
68
|
target: 'add',
|
|
@@ -79,47 +75,15 @@ module.exports = class CDSGenerator {
|
|
|
79
75
|
description: `Add sample content to your project.`,
|
|
80
76
|
default: '',
|
|
81
77
|
choices: [
|
|
82
|
-
{ name: 'Basic Sample Files', value:
|
|
78
|
+
{ name: 'Basic Sample Files', value: SAMPLES }
|
|
83
79
|
],
|
|
84
80
|
multiple: true,
|
|
85
81
|
target: 'add',
|
|
86
82
|
guiOptions: {
|
|
87
83
|
hint: 'Speed up your ramp-up phase with some sample files in your project.'
|
|
88
84
|
}
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
// OPTION_HELM this.config
|
|
92
85
|
}
|
|
93
86
|
]
|
|
94
|
-
|
|
95
|
-
// legacy handling for generator-cap-project < 3.0
|
|
96
|
-
// does not contain OPTION_NODJES since old Yeoman generator
|
|
97
|
-
// cannot handle types correctly
|
|
98
|
-
this.config = {
|
|
99
|
-
add: {
|
|
100
|
-
title: `Features`,
|
|
101
|
-
description: `Select the features for the new project.`,
|
|
102
|
-
default: '',
|
|
103
|
-
// choices: OPTIONS_PRIORITY.filter((currOption) => currOption !== OPTION_NODEJS),
|
|
104
|
-
choices: [
|
|
105
|
-
OPTION_JAVA,
|
|
106
|
-
OPTION_HANA,
|
|
107
|
-
OPTION_XSUAA,
|
|
108
|
-
OPTION_PIPELINE,
|
|
109
|
-
OPTION_CF_MANIFEST,
|
|
110
|
-
OPTION_MTA,
|
|
111
|
-
OPTION_SAMPLES,
|
|
112
|
-
OPTION_KIBANA_LOGGING,
|
|
113
|
-
OPTION_HELM,
|
|
114
|
-
OPTION_SAMPLES
|
|
115
|
-
],
|
|
116
|
-
multiple: true,
|
|
117
|
-
promptOrder: 10 // used to identify ui prompts
|
|
118
|
-
},
|
|
119
|
-
force: {
|
|
120
|
-
default: false
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
87
|
}
|
|
124
88
|
|
|
125
89
|
/**
|
|
@@ -205,6 +169,7 @@ module.exports = class CDSGenerator {
|
|
|
205
169
|
const msg = `Adding feature '${template.name}'...`;
|
|
206
170
|
LOG.info(msg);
|
|
207
171
|
await template.run();
|
|
172
|
+
await template.runRelatedMerging();
|
|
208
173
|
}
|
|
209
174
|
|
|
210
175
|
LOG.info(`Done adding features`);
|
|
@@ -251,8 +216,9 @@ module.exports = class CDSGenerator {
|
|
|
251
216
|
}
|
|
252
217
|
}
|
|
253
218
|
|
|
219
|
+
const cmds = Object.values(OPTIONS);
|
|
254
220
|
this.templateList = Array.from(templates.entries()).sort(([a], [b]) => {
|
|
255
|
-
return
|
|
221
|
+
return cmds.indexOf(a) - cmds.indexOf(b);
|
|
256
222
|
}).map((entry) => entry[1]);
|
|
257
223
|
|
|
258
224
|
// check debug to avoid lengthy computation when not in debug mode
|
|
@@ -297,8 +263,8 @@ module.exports = class CDSGenerator {
|
|
|
297
263
|
// set is ordered ... always
|
|
298
264
|
this.options.add = new Set(trimmedTokens);
|
|
299
265
|
|
|
300
|
-
if (this.options._cmd === COMMAND_INIT && !this.options.add.has(
|
|
301
|
-
this.options.add.add(
|
|
266
|
+
if (this.options._cmd === COMMAND_INIT && !this.options.add.has(JAVA)) {
|
|
267
|
+
this.options.add.add(NODEJS);
|
|
302
268
|
}
|
|
303
269
|
|
|
304
270
|
this._checkAdditionalOptions();
|
|
@@ -31,16 +31,32 @@ const approuter = {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
const xsuaa = {
|
|
34
|
+
in: 'resources',
|
|
35
|
+
where: [{
|
|
36
|
+
property: 'parameters.service',
|
|
37
|
+
isEqualTo: 'xsuaa',
|
|
38
|
+
}]
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const destination = {
|
|
34
42
|
in: 'resources',
|
|
35
43
|
where: [{
|
|
36
44
|
property: 'type',
|
|
37
45
|
isEqualTo: 'org.cloudfoundry.managed-service',
|
|
38
46
|
}, {
|
|
39
47
|
property: 'parameters.service',
|
|
40
|
-
isEqualTo: '
|
|
48
|
+
isEqualTo: 'destination',
|
|
49
|
+
}]
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const connectivity = {
|
|
53
|
+
in: 'resources',
|
|
54
|
+
where: [{
|
|
55
|
+
property: 'type',
|
|
56
|
+
isEqualTo: 'org.cloudfoundry.managed-service',
|
|
41
57
|
}, {
|
|
42
|
-
property: 'parameters.service
|
|
43
|
-
isEqualTo: '
|
|
58
|
+
property: 'parameters.service',
|
|
59
|
+
isEqualTo: 'connectivity',
|
|
44
60
|
}]
|
|
45
61
|
}
|
|
46
62
|
|
|
@@ -245,6 +261,8 @@ module.exports = {
|
|
|
245
261
|
approuter,
|
|
246
262
|
xsuaa,
|
|
247
263
|
auditlog,
|
|
264
|
+
destination,
|
|
265
|
+
connectivity,
|
|
248
266
|
enterpriseMessaging,
|
|
249
267
|
hdbDeployer,
|
|
250
268
|
hdiContainer,
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
---
|
|
2
2
|
modules:
|
|
3
|
-
- name: {{
|
|
4
|
-
type: {{
|
|
5
|
-
path: {{&
|
|
6
|
-
{{#
|
|
7
|
-
{{#
|
|
3
|
+
- name: {{appName}}-srv
|
|
4
|
+
type: {{language}}
|
|
5
|
+
path: {{& srvPath}}
|
|
6
|
+
{{#isJava}}
|
|
7
|
+
{{#isMultitenant}}
|
|
8
8
|
properties:
|
|
9
9
|
CDS_MULTITENANCY_APPUI_TENANTSEPARATOR: "-"
|
|
10
|
-
{{/
|
|
11
|
-
{{/
|
|
10
|
+
{{/isMultitenant}}
|
|
11
|
+
{{/isJava}}
|
|
12
12
|
requires:
|
|
13
|
-
- name: {{
|
|
14
|
-
{{#
|
|
13
|
+
- name: {{appName}}-auth
|
|
14
|
+
{{#isJava}}
|
|
15
15
|
- name: app-api
|
|
16
16
|
properties:
|
|
17
17
|
CDS_MULTITENANCY_APPUI_URL: ~{url}
|
|
18
|
-
{{/
|
|
18
|
+
{{/isJava}}
|
|
19
19
|
|
|
20
|
-
- name: {{
|
|
20
|
+
- name: {{appName}}
|
|
21
21
|
type: approuter.nodejs
|
|
22
|
-
path: {{&
|
|
22
|
+
path: {{& appPath}} # from cds.env.folders. Consider also cds.env.build.target -> gen/app
|
|
23
23
|
parameters:
|
|
24
24
|
keep-existing-routes: true
|
|
25
25
|
disk-quota: 256M
|
|
26
26
|
memory: 256M
|
|
27
|
-
{{#
|
|
27
|
+
{{#isMultitenant}}
|
|
28
28
|
properties:
|
|
29
29
|
TENANT_HOST_PATTERN: "^(.*)-${default-uri}"
|
|
30
|
-
{{/
|
|
30
|
+
{{/isMultitenant}}
|
|
31
31
|
requires:
|
|
32
32
|
- name: srv-api
|
|
33
33
|
group: destinations
|
|
@@ -35,46 +35,46 @@ modules:
|
|
|
35
35
|
name: srv-api # must be used in xs-app.json as well
|
|
36
36
|
url: ~{srv-url}
|
|
37
37
|
forwardAuthToken: true
|
|
38
|
-
{{#
|
|
38
|
+
{{#isMultitenant}}
|
|
39
39
|
- name: mtx-api
|
|
40
40
|
group: destinations
|
|
41
41
|
properties:
|
|
42
42
|
name: mtx-api # must be used in xs-app.json as well
|
|
43
43
|
url: ~{mtx-url}
|
|
44
|
-
{{/
|
|
45
|
-
{{#
|
|
46
|
-
{{#
|
|
44
|
+
{{/isMultitenant}}
|
|
45
|
+
{{#isMultitenant}}
|
|
46
|
+
{{#isNodejs}}
|
|
47
47
|
provides:
|
|
48
48
|
- name: app-api
|
|
49
49
|
properties:
|
|
50
50
|
app-protocol: ${protocol}
|
|
51
51
|
app-uri: ${default-uri}
|
|
52
|
-
{{/
|
|
53
|
-
{{/
|
|
54
|
-
{{#
|
|
52
|
+
{{/isNodejs}}
|
|
53
|
+
{{/isMultitenant}}
|
|
54
|
+
{{#isJava}}
|
|
55
55
|
provides:
|
|
56
56
|
- name: app-api
|
|
57
57
|
properties:
|
|
58
58
|
url: ${default-url}
|
|
59
|
-
{{/
|
|
59
|
+
{{/isJava}}
|
|
60
60
|
|
|
61
|
-
{{#
|
|
62
|
-
- name: {{
|
|
61
|
+
{{#isMultitenant}}
|
|
62
|
+
- name: {{appName}}-mtx
|
|
63
63
|
type: nodejs
|
|
64
|
-
path: {{#
|
|
64
|
+
path: {{#isNodejs}}gen/{{/isNodejs}}mtx/sidecar
|
|
65
65
|
requires:
|
|
66
66
|
- name: app-api
|
|
67
67
|
properties:
|
|
68
68
|
SUBSCRIPTION_URL: ~{app-protocol}://\${tenant_subdomain}-~{app-uri}
|
|
69
|
-
{{/
|
|
69
|
+
{{/isMultitenant}}
|
|
70
70
|
|
|
71
71
|
resources:
|
|
72
|
-
- name: {{
|
|
72
|
+
- name: {{appName}}-auth
|
|
73
73
|
type: org.cloudfoundry.managed-service
|
|
74
74
|
parameters:
|
|
75
75
|
service: xsuaa
|
|
76
76
|
service-plan: application
|
|
77
77
|
path: ./xs-security.json
|
|
78
78
|
config:
|
|
79
|
-
xsappname: {{
|
|
80
|
-
tenant-mode: {{#
|
|
79
|
+
xsappname: {{appName}}-${org}-${space}
|
|
80
|
+
tenant-mode: {{#isMultitenant}}shared{{/isMultitenant}}{{^isMultitenant}}dedicated{{/isMultitenant}}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
---
|
|
2
|
-
{{#
|
|
2
|
+
{{#hasXsuaa}}
|
|
3
3
|
xsuaa:
|
|
4
4
|
parameters:
|
|
5
5
|
oauth2-configuration:
|
|
6
6
|
redirect-uris:
|
|
7
7
|
- https://*.<your-cluster-domain>/**
|
|
8
|
-
{{/
|
|
8
|
+
{{/hasXsuaa}}
|
|
9
9
|
approuter:
|
|
10
|
-
{{#
|
|
10
|
+
{{#hasXsuaa}}
|
|
11
11
|
bindings:
|
|
12
12
|
auth:
|
|
13
13
|
serviceInstanceName: xsuaa
|
|
14
|
-
{{/
|
|
14
|
+
{{/hasXsuaa}}
|
|
15
15
|
image:
|
|
16
|
-
repository: <your-container-registry>/{{
|
|
16
|
+
repository: <your-container-registry>/{{appName}}-approuter
|
|
17
17
|
tag: latest
|
|
18
18
|
resources:
|
|
19
19
|
limits:
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
+
"welcomeFile": "app/index.html",
|
|
2
3
|
"routes": [
|
|
3
|
-
{{#
|
|
4
|
+
{{#isExtensible}}
|
|
4
5
|
{
|
|
5
6
|
"source": "^/-/cds/.*",
|
|
6
7
|
"destination": "mtx-api",
|
|
7
8
|
"authenticationType": "none"
|
|
8
9
|
},
|
|
9
|
-
{{/
|
|
10
|
+
{{/isExtensible}}
|
|
10
11
|
{
|
|
11
12
|
"source": "^/app/(.*)$",
|
|
12
13
|
"target": "$1",
|
|
13
14
|
"localDir": ".",
|
|
14
15
|
"cacheControl": "no-cache, no-store, must-revalidate"
|
|
15
16
|
},
|
|
17
|
+
{
|
|
18
|
+
"source": "^/appconfig/",
|
|
19
|
+
"localDir": ".",
|
|
20
|
+
"cacheControl": "no-cache, no-store, must-revalidate"
|
|
21
|
+
},
|
|
16
22
|
{
|
|
17
23
|
"source": "^/(.*)$",
|
|
18
24
|
"target": "$1",
|
|
@@ -2,8 +2,8 @@ const cds = require('../../../cds')
|
|
|
2
2
|
const { exists } = cds.utils
|
|
3
3
|
const { join } = require('path')
|
|
4
4
|
const { readProject } = require('../../util/projectReader')
|
|
5
|
-
const { mergeJSON, mergeYAML,
|
|
6
|
-
const {
|
|
5
|
+
const { mergeJSON, mergeYAML, sort } = require('../../util/merge')
|
|
6
|
+
const { XSUAA } = require('../../constants').OPTIONS
|
|
7
7
|
const {
|
|
8
8
|
srvNode4, srvJava4, mtxSidecar4, approuter, // Modules
|
|
9
9
|
xsuaa, // BTP Services
|
|
@@ -20,22 +20,21 @@ module.exports = class ApprouterTemplate extends require('../templateBase') {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
getDependencies() {
|
|
23
|
-
return [
|
|
23
|
+
return [XSUAA]
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
async run() {
|
|
27
|
-
const
|
|
28
|
-
const appPath = projectDescriptor.ui.appPath ?? 'app'
|
|
27
|
+
const { appPath = 'app' } = await readProject(this.options)
|
|
29
28
|
const appPackageJSONPath = join(appPath, 'package.json')
|
|
30
29
|
await mergeJSON(appPackageJSONPath, join(__dirname, 'files', 'package.json'))
|
|
31
|
-
await
|
|
30
|
+
await sort(appPackageJSONPath, 'dependencies')
|
|
32
31
|
await mergeJSON(join(appPath, 'default-env.json'), join(__dirname, 'files', 'default-env.json'))
|
|
33
32
|
await this.runDependentMerging()
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
async runDependentMerging(context = {}) {
|
|
37
36
|
const projectDescriptor = await readProject(this.options)
|
|
38
|
-
const { isNodejs, isJava, isExtensible, isMultitenant, hasMta, hasHelm, srvPath } = projectDescriptor
|
|
37
|
+
const { isNodejs, isJava, isExtensible, isMultitenant, hasMta, hasHelm, srvPath } = projectDescriptor
|
|
39
38
|
|
|
40
39
|
if (hasMta) {
|
|
41
40
|
const srv = (isNodejs ? srvNode4 : srvJava4)(srvPath)
|
|
@@ -114,7 +113,7 @@ module.exports = class ApprouterTemplate extends require('../templateBase') {
|
|
|
114
113
|
if (isIndependentCommand) await writeMd5File(join('chart', '.cds-add-helm-files.md5'), context.newTrackingData);
|
|
115
114
|
}
|
|
116
115
|
|
|
117
|
-
const xsAppPath = join(projectDescriptor.
|
|
116
|
+
const xsAppPath = join(projectDescriptor.appPath ?? 'app', 'xs-app.json')
|
|
118
117
|
const additions = isExtensible ? [{ ...approuterExtensibility, at: 0 }] : []
|
|
119
118
|
await mergeJSON(xsAppPath, join(__dirname, 'files', 'xs-app.json.hbs'), projectDescriptor, { additions })
|
|
120
119
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
modules:
|
|
3
|
-
- name: {{
|
|
4
|
-
type: {{
|
|
5
|
-
path: {{&
|
|
3
|
+
- name: {{appName}}-srv
|
|
4
|
+
type: {{language}}
|
|
5
|
+
path: {{& srvPath}}
|
|
6
6
|
requires:
|
|
7
|
-
- name: {{
|
|
7
|
+
- name: {{appName}}-auditlog
|
|
8
8
|
|
|
9
9
|
resources:
|
|
10
|
-
- name: {{
|
|
10
|
+
- name: {{appName}}-auditlog
|
|
11
11
|
type: org.cloudfoundry.managed-service
|
|
12
12
|
parameters:
|
|
13
13
|
service: auditlog-api
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
|
-
{{#
|
|
2
|
+
{{#isNodejs}}
|
|
3
3
|
"dependencies": {
|
|
4
4
|
"@sap/audit-logging": "^5"
|
|
5
5
|
},
|
|
6
6
|
"cds": {
|
|
7
|
-
{{/
|
|
7
|
+
{{/isNodejs}}
|
|
8
8
|
"requires": {
|
|
9
|
-
{{#
|
|
10
|
-
"[{{
|
|
11
|
-
{{/
|
|
12
|
-
{{#
|
|
9
|
+
{{#profile}}
|
|
10
|
+
"[{{profile}}]": {
|
|
11
|
+
{{/profile}}
|
|
12
|
+
{{#shortcut}}
|
|
13
13
|
"audit-log": "service"
|
|
14
|
-
{{/
|
|
15
|
-
{{^
|
|
14
|
+
{{/shortcut}}
|
|
15
|
+
{{^shortcut}}
|
|
16
16
|
"audit-log": {
|
|
17
17
|
"kind": "service"
|
|
18
18
|
}
|
|
19
|
-
{{/
|
|
20
|
-
{{#
|
|
19
|
+
{{/shortcut}}
|
|
20
|
+
{{#profile}}
|
|
21
21
|
}
|
|
22
|
-
{{/
|
|
22
|
+
{{/profile}}
|
|
23
23
|
}
|
|
24
|
-
{{#
|
|
24
|
+
{{#isNodejs}}
|
|
25
25
|
}
|
|
26
|
-
{{/
|
|
26
|
+
{{/isNodejs}}
|
|
27
27
|
}
|
|
@@ -14,15 +14,15 @@ module.exports = class AuditlogTemplate extends require('../templateBase') {
|
|
|
14
14
|
|
|
15
15
|
async run() {
|
|
16
16
|
const projectDescriptor = await readProject(this.options)
|
|
17
|
-
const { configFile } = projectDescriptor
|
|
18
|
-
projectDescriptor.
|
|
17
|
+
const { configFile } = projectDescriptor
|
|
18
|
+
projectDescriptor.shortcut = !(await read(configFile)).cds?.requires?.['audit-log']?.kind
|
|
19
19
|
await mergeJSON(configFile, join(__dirname, 'files', 'package.json.hbs'), projectDescriptor)
|
|
20
20
|
await this.runDependentMerging()
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
async runDependentMerging(context = {}) {
|
|
24
24
|
const projectDescriptor = await readProject(this.options)
|
|
25
|
-
const { isNodejs, hasMta, hasHelm, srvPath } = projectDescriptor
|
|
25
|
+
const { isNodejs, hasMta, hasHelm, srvPath } = projectDescriptor
|
|
26
26
|
|
|
27
27
|
if (hasMta) {
|
|
28
28
|
const srv = (isNodejs ? srvNode4 : srvJava4)(srvPath)
|