@sap/cds-dk 7.0.1 → 7.0.3
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/add.js +36 -40
- package/bin/bind.js +0 -1
- package/bin/build.js +4 -0
- package/bin/cds.js +14 -8
- package/bin/compile/index.js +3 -3
- package/bin/deploy/to-hana.js +1 -1
- package/bin/help.js +2 -3
- package/bin/init.js +2 -2
- package/lib/bind/cfKeyProvider.js +1 -0
- package/lib/bind/index.js +3 -0
- package/lib/bind/userCdsrcJsonStorageProvider.js +2 -10
- package/lib/build/buildTaskEngine.js +1 -1
- package/lib/build/constants.js +16 -14
- package/lib/build/provider/buildTaskHandlerFeatureToggles.js +2 -1
- package/lib/build/provider/java/index.js +2 -2
- package/lib/build/provider/mtx/resourcesTarBuilder.js +2 -6
- package/lib/build/provider/mtx-sidecar/index.js +15 -11
- package/lib/build/util.js +8 -0
- package/lib/cds.js +2 -2
- package/lib/client/base_command.js +3 -6
- package/lib/compile/asyncapi/components/messages/index.js +41 -18
- package/lib/compile/asyncapi/index.js +23 -2
- package/lib/import/odata/metadataconverter/MetadataConverter.js +1 -0
- package/lib/init/constants.js +5 -5
- package/lib/init/index.js +68 -76
- package/lib/init/template/_merging/registry-mta.js +2 -2
- package/lib/init/template/approuter/index.js +10 -7
- package/lib/init/template/auditlog/index.js +3 -4
- package/lib/init/template/cf-manifest/files/manifest.yml.hbs +15 -23
- package/lib/init/template/cf-manifest/files/services-manifest.yml.hbs +22 -17
- package/lib/init/template/cf-manifest/index.js +5 -5
- package/lib/init/template/connectivity/index.js +2 -3
- package/lib/init/template/data/index.js +6 -6
- package/lib/init/template/destination/index.js +3 -5
- package/lib/init/template/enterprise-messaging/index.js +4 -5
- package/lib/init/template/enterprise-messaging-shared/index.js +3 -4
- package/lib/init/template/extensibility/index.js +2 -3
- package/lib/init/template/file-based-messaging/index.js +2 -2
- package/lib/init/template/hana/files/mta.yaml.hbs +1 -1
- package/lib/init/template/hana/index.js +39 -63
- package/lib/init/template/helm/index.js +15 -14
- package/lib/init/template/html5-repo/index.js +3 -7
- package/lib/init/template/java/index.js +6 -6
- package/lib/init/template/kibana/files/mta.yaml.hbs +29 -0
- package/lib/init/template/kibana/index.js +54 -0
- package/lib/init/template/lint/index.js +8 -7
- package/lib/init/template/mta/index.js +3 -2
- package/lib/init/template/multitenancy/files/package.json.hbs +0 -3
- package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +1 -1
- package/lib/init/template/multitenancy/index.js +25 -40
- package/lib/init/template/nodejs/index.js +4 -5
- package/lib/init/template/pipeline/index.js +3 -3
- package/lib/init/template/redis-messaging/index.js +3 -4
- package/lib/init/template/sample/files/app/_i18n/i18n.properties +3 -32
- package/lib/init/template/sample/files/app/_i18n/i18n_de.properties +2 -2
- package/lib/init/template/sample/files/app/admin-books/fiori-service.cds +6 -7
- package/lib/init/template/sample/files/app/admin-books/webapp/Component.js +3 -3
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n.properties +3 -11
- package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +117 -113
- package/lib/init/template/sample/files/app/appconfig/fioriSandboxConfig.json +38 -0
- package/lib/init/template/sample/files/app/browse/fiori-service.cds +56 -0
- package/lib/init/template/sample/files/app/browse/webapp/Component.js +7 -0
- package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n.properties +4 -0
- package/lib/init/template/sample/files/app/browse/webapp/manifest.json +139 -0
- package/lib/init/template/sample/files/app/common.cds +78 -81
- package/lib/init/template/sample/files/app/services.cds +1 -0
- package/lib/init/template/sample/files/srv/admin-service.cds +1 -1
- package/lib/init/template/sample/files/srv/cat-service.cds +1 -1
- package/lib/init/template/sample/index.js +6 -5
- package/lib/init/template/sqlite/index.js +1 -1
- package/lib/init/template/templateBase.js +9 -19
- package/lib/init/template/tiny-sample/index.js +6 -6
- package/lib/init/template/toggles/index.js +1 -2
- package/lib/init/template/typer/files/xsconfig.json +0 -1
- package/lib/init/template/typer/index.js +1 -1
- package/lib/init/template/xsuaa/index.js +3 -4
- package/lib/init/util/indent.js +57 -0
- package/lib/init/util/merge.js +71 -15
- package/lib/init/util/mvn.js +24 -10
- package/lib/init/util/projectReader.js +53 -169
- package/lib/init/util/template.js +12 -11
- package/lib/init/util/xml.js +6 -6
- package/lib/util/pruneAxiosErrors.js +22 -0
- package/lib/watch/open.js +6 -3
- package/npm-shrinkwrap.json +20 -37
- package/package.json +1 -2
- package/lib/init/template/kibana-logging/files/cds.package.json +0 -7
- package/lib/init/template/kibana-logging/files/mta.yaml.hbs +0 -14
- package/lib/init/template/kibana-logging/index.js +0 -45
- /package/lib/init/template/{kibana-logging → kibana}/files/package.json.hbs +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
using { CatalogService } from '../../srv/cat-service.cds';
|
|
2
|
+
|
|
3
|
+
////////////////////////////////////////////////////////////////////////////
|
|
4
|
+
//
|
|
5
|
+
// Books Object Page
|
|
6
|
+
//
|
|
7
|
+
annotate CatalogService.Books with @(UI : {
|
|
8
|
+
HeaderInfo: {
|
|
9
|
+
TypeName : 'Book',
|
|
10
|
+
TypeNamePlural: 'Books',
|
|
11
|
+
Description : {Value : author}
|
|
12
|
+
},
|
|
13
|
+
HeaderFacets: [{
|
|
14
|
+
$Type : 'UI.ReferenceFacet',
|
|
15
|
+
Label : '{i18n>Description}',
|
|
16
|
+
Target: '@UI.FieldGroup#Descr'
|
|
17
|
+
}, ],
|
|
18
|
+
Facets: [{
|
|
19
|
+
$Type : 'UI.ReferenceFacet',
|
|
20
|
+
Label : '{i18n>Details}',
|
|
21
|
+
Target: '@UI.FieldGroup#Price'
|
|
22
|
+
}, ],
|
|
23
|
+
FieldGroup #Descr: {Data : [{Value : descr}, ]},
|
|
24
|
+
FieldGroup #Price: {Data : [
|
|
25
|
+
{Value: price},
|
|
26
|
+
{
|
|
27
|
+
Value: currency.symbol,
|
|
28
|
+
Label: '{i18n>Currency}'
|
|
29
|
+
},
|
|
30
|
+
]},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
////////////////////////////////////////////////////////////////////////////
|
|
34
|
+
//
|
|
35
|
+
// Books List Page
|
|
36
|
+
//
|
|
37
|
+
annotate CatalogService.Books with @(UI : {
|
|
38
|
+
SelectionFields: [
|
|
39
|
+
ID,
|
|
40
|
+
price,
|
|
41
|
+
currency_code
|
|
42
|
+
],
|
|
43
|
+
LineItem: [
|
|
44
|
+
{
|
|
45
|
+
Value: ID,
|
|
46
|
+
Label: '{i18n>Title}'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
Value: author,
|
|
50
|
+
Label: '{i18n>Author}'
|
|
51
|
+
},
|
|
52
|
+
{Value: genre.name},
|
|
53
|
+
{Value: price},
|
|
54
|
+
{Value: currency.symbol},
|
|
55
|
+
]
|
|
56
|
+
});
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_version": "1.49.0",
|
|
3
|
+
"sap.app": {
|
|
4
|
+
"id": "bookshop",
|
|
5
|
+
"applicationVersion": {
|
|
6
|
+
"version": "1.0.0"
|
|
7
|
+
},
|
|
8
|
+
"type": "application",
|
|
9
|
+
"title": "{{appTitle}}",
|
|
10
|
+
"description": "{{appDescription}}",
|
|
11
|
+
"i18n": "i18n/i18n.properties",
|
|
12
|
+
"dataSources": {
|
|
13
|
+
"CatalogService": {
|
|
14
|
+
"uri": "/odata/v4/catalog/",
|
|
15
|
+
"type": "OData",
|
|
16
|
+
"settings": {
|
|
17
|
+
"odataVersion": "4.0"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"crossNavigation": {
|
|
22
|
+
"inbounds": {
|
|
23
|
+
"intent1": {
|
|
24
|
+
"signature": {
|
|
25
|
+
"parameters": {
|
|
26
|
+
"Books.ID": {
|
|
27
|
+
"renameTo": "ID"
|
|
28
|
+
},
|
|
29
|
+
"Authors.books.ID": {
|
|
30
|
+
"renameTo": "ID"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"additionalParameters": "ignored"
|
|
34
|
+
},
|
|
35
|
+
"semanticObject": "Books",
|
|
36
|
+
"action": "display",
|
|
37
|
+
"title": "{{appTitle}}",
|
|
38
|
+
"info": "{{appInfo}}",
|
|
39
|
+
"subTitle": "{{appSubTitle}}",
|
|
40
|
+
"icon": "sap-icon://course-book",
|
|
41
|
+
"indicatorDataSource": {
|
|
42
|
+
"dataSource": "CatalogService",
|
|
43
|
+
"path": "Books/$count",
|
|
44
|
+
"refresh": 1800
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"sap.ui": {
|
|
51
|
+
"technology": "UI5",
|
|
52
|
+
"fullWidth": false,
|
|
53
|
+
"deviceTypes": {
|
|
54
|
+
"desktop": true,
|
|
55
|
+
"tablet": true,
|
|
56
|
+
"phone": true
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"sap.ui5": {
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"minUI5Version": "1.115.1",
|
|
62
|
+
"libs": {
|
|
63
|
+
"sap.fe.templates": {}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"models": {
|
|
67
|
+
"i18n": {
|
|
68
|
+
"type": "sap.ui.model.resource.ResourceModel",
|
|
69
|
+
"uri": "i18n/i18n.properties"
|
|
70
|
+
},
|
|
71
|
+
"": {
|
|
72
|
+
"dataSource": "CatalogService",
|
|
73
|
+
"settings": {
|
|
74
|
+
"synchronizationMode": "None",
|
|
75
|
+
"operationMode": "Server",
|
|
76
|
+
"autoExpandSelect": true,
|
|
77
|
+
"earlyRequests": true,
|
|
78
|
+
"groupProperties": {
|
|
79
|
+
"default": {
|
|
80
|
+
"submit": "Auto"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"routing": {
|
|
87
|
+
"routes": [
|
|
88
|
+
{
|
|
89
|
+
"pattern": ":?query:",
|
|
90
|
+
"name": "BooksList",
|
|
91
|
+
"target": "BooksList"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"pattern": "Books({key}):?query:",
|
|
95
|
+
"name": "BooksDetails",
|
|
96
|
+
"target": "BooksDetails"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"targets": {
|
|
100
|
+
"BooksList": {
|
|
101
|
+
"type": "Component",
|
|
102
|
+
"id": "BooksList",
|
|
103
|
+
"name": "sap.fe.templates.ListReport",
|
|
104
|
+
"options": {
|
|
105
|
+
"settings": {
|
|
106
|
+
"entitySet": "Books",
|
|
107
|
+
"initialLoad": true,
|
|
108
|
+
"navigation": {
|
|
109
|
+
"Books": {
|
|
110
|
+
"detail": {
|
|
111
|
+
"route": "BooksDetails"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"BooksDetails": {
|
|
119
|
+
"type": "Component",
|
|
120
|
+
"id": "BooksDetailsList",
|
|
121
|
+
"name": "sap.fe.templates.ObjectPage",
|
|
122
|
+
"options": {
|
|
123
|
+
"settings": {
|
|
124
|
+
"entitySet": "Books"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"contentDensities": {
|
|
131
|
+
"compact": true,
|
|
132
|
+
"cozy": true
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"sap.fiori": {
|
|
136
|
+
"registrationIds": [],
|
|
137
|
+
"archeType": "transactional"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -10,16 +10,16 @@ using { sap.common, sap.common.Currencies } from '@sap/cds/common';
|
|
|
10
10
|
// Books Lists
|
|
11
11
|
//
|
|
12
12
|
annotate my.Books with @(
|
|
13
|
-
Common.SemanticKey
|
|
14
|
-
UI
|
|
15
|
-
Identification
|
|
16
|
-
SelectionFields
|
|
13
|
+
Common.SemanticKey: [ID],
|
|
14
|
+
UI: {
|
|
15
|
+
Identification: [{ Value: title }],
|
|
16
|
+
SelectionFields: [
|
|
17
17
|
ID,
|
|
18
18
|
author_ID,
|
|
19
19
|
price,
|
|
20
20
|
currency_code
|
|
21
21
|
],
|
|
22
|
-
LineItem
|
|
22
|
+
LineItem: [
|
|
23
23
|
{ Value: ID, Label: '{i18n>Title}' },
|
|
24
24
|
{ Value: author.ID, Label: '{i18n>Author}' },
|
|
25
25
|
{ Value: genre.name },
|
|
@@ -29,16 +29,16 @@ annotate my.Books with @(
|
|
|
29
29
|
]
|
|
30
30
|
}
|
|
31
31
|
) {
|
|
32
|
-
ID
|
|
33
|
-
SemanticObject
|
|
32
|
+
ID @Common: {
|
|
33
|
+
SemanticObject: 'Books',
|
|
34
34
|
Text: title,
|
|
35
|
-
TextArrangement
|
|
35
|
+
TextArrangement: #TextOnly
|
|
36
36
|
};
|
|
37
|
-
author @ValueList.entity
|
|
37
|
+
author @ValueList.entity: 'Authors';
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
annotate Currencies with {
|
|
41
|
-
symbol @Common.Label
|
|
41
|
+
symbol @Common.Label: '{i18n>Currency}';
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
////////////////////////////////////////////////////////////////////////////
|
|
@@ -46,10 +46,10 @@ annotate Currencies with {
|
|
|
46
46
|
// Books Details
|
|
47
47
|
//
|
|
48
48
|
annotate my.Books with @(UI : {HeaderInfo : {
|
|
49
|
-
TypeName
|
|
50
|
-
TypeNamePlural
|
|
51
|
-
Title
|
|
52
|
-
Description
|
|
49
|
+
TypeName : '{i18n>Book}',
|
|
50
|
+
TypeNamePlural: '{i18n>Books}',
|
|
51
|
+
Title : { Value: title },
|
|
52
|
+
Description : { Value: author.name }
|
|
53
53
|
}, });
|
|
54
54
|
|
|
55
55
|
|
|
@@ -62,9 +62,9 @@ annotate my.Books with {
|
|
|
62
62
|
title @title: '{i18n>Title}';
|
|
63
63
|
genre @title: '{i18n>Genre}' @Common: { Text: genre.name, TextArrangement: #TextOnly };
|
|
64
64
|
author @title: '{i18n>Author}' @Common: { Text: author.name, TextArrangement: #TextOnly };
|
|
65
|
-
price @title: '{i18n>Price}' @Measures.ISOCurrency
|
|
65
|
+
price @title: '{i18n>Price}' @Measures.ISOCurrency: currency_code;
|
|
66
66
|
stock @title: '{i18n>Stock}';
|
|
67
|
-
descr @title: '{i18n>Description}'
|
|
67
|
+
descr @title: '{i18n>Description}' @UI.MultiLineText;
|
|
68
68
|
image @title: '{i18n>Image}';
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -73,13 +73,13 @@ annotate my.Books with {
|
|
|
73
73
|
// Genres List
|
|
74
74
|
//
|
|
75
75
|
annotate my.Genres with @(
|
|
76
|
-
Common.SemanticKey
|
|
77
|
-
UI
|
|
78
|
-
SelectionFields
|
|
79
|
-
LineItem
|
|
76
|
+
Common.SemanticKey: [name],
|
|
77
|
+
UI: {
|
|
78
|
+
SelectionFields: [name],
|
|
79
|
+
LineItem: [
|
|
80
80
|
{ Value: name },
|
|
81
81
|
{
|
|
82
|
-
Value
|
|
82
|
+
Value: parent.name,
|
|
83
83
|
Label: 'Main Genre'
|
|
84
84
|
},
|
|
85
85
|
],
|
|
@@ -95,17 +95,17 @@ annotate my.Genres with {
|
|
|
95
95
|
// Genre Details
|
|
96
96
|
//
|
|
97
97
|
annotate my.Genres with @(UI : {
|
|
98
|
-
Identification
|
|
99
|
-
HeaderInfo
|
|
100
|
-
TypeName
|
|
101
|
-
TypeNamePlural
|
|
102
|
-
Title
|
|
103
|
-
Description
|
|
98
|
+
Identification: [{ Value: name}],
|
|
99
|
+
HeaderInfo: {
|
|
100
|
+
TypeName : '{i18n>Genre}',
|
|
101
|
+
TypeNamePlural: '{i18n>Genres}',
|
|
102
|
+
Title : { Value: name },
|
|
103
|
+
Description : { Value: ID }
|
|
104
104
|
},
|
|
105
|
-
Facets
|
|
106
|
-
$Type
|
|
107
|
-
Label
|
|
108
|
-
Target
|
|
105
|
+
Facets: [{
|
|
106
|
+
$Type : 'UI.ReferenceFacet',
|
|
107
|
+
Label : '{i18n>SubGenres}',
|
|
108
|
+
Target: 'children/@UI.LineItem'
|
|
109
109
|
}, ],
|
|
110
110
|
});
|
|
111
111
|
|
|
@@ -123,11 +123,11 @@ annotate my.Genres with {
|
|
|
123
123
|
// Authors List
|
|
124
124
|
//
|
|
125
125
|
annotate my.Authors with @(
|
|
126
|
-
Common.SemanticKey
|
|
127
|
-
UI
|
|
128
|
-
Identification
|
|
129
|
-
SelectionFields
|
|
130
|
-
LineItem
|
|
126
|
+
Common.SemanticKey: [ID],
|
|
127
|
+
UI: {
|
|
128
|
+
Identification : [{ Value: name}],
|
|
129
|
+
SelectionFields: [ name ],
|
|
130
|
+
LineItem : [
|
|
131
131
|
{ Value: ID },
|
|
132
132
|
{ Value: dateOfBirth },
|
|
133
133
|
{ Value: dateOfDeath },
|
|
@@ -136,10 +136,10 @@ annotate my.Authors with @(
|
|
|
136
136
|
],
|
|
137
137
|
}
|
|
138
138
|
) {
|
|
139
|
-
ID
|
|
140
|
-
SemanticObject
|
|
139
|
+
ID @Common: {
|
|
140
|
+
SemanticObject: 'Authors',
|
|
141
141
|
Text: name,
|
|
142
|
-
TextArrangement
|
|
142
|
+
TextArrangement: #TextOnly,
|
|
143
143
|
};
|
|
144
144
|
};
|
|
145
145
|
|
|
@@ -148,16 +148,16 @@ annotate my.Authors with @(
|
|
|
148
148
|
// Author Details
|
|
149
149
|
//
|
|
150
150
|
annotate my.Authors with @(UI : {
|
|
151
|
-
HeaderInfo
|
|
152
|
-
TypeName
|
|
153
|
-
TypeNamePlural
|
|
154
|
-
Title
|
|
155
|
-
Description
|
|
151
|
+
HeaderInfo: {
|
|
152
|
+
TypeName : '{i18n>Author}',
|
|
153
|
+
TypeNamePlural: '{i18n>Authors}',
|
|
154
|
+
Title : { Value: name },
|
|
155
|
+
Description : { Value: dateOfBirth }
|
|
156
156
|
},
|
|
157
|
-
Facets
|
|
158
|
-
$Type
|
|
159
|
-
Target
|
|
160
|
-
}
|
|
157
|
+
Facets: [{
|
|
158
|
+
$Type : 'UI.ReferenceFacet',
|
|
159
|
+
Target: 'books/@UI.LineItem'
|
|
160
|
+
}],
|
|
161
161
|
});
|
|
162
162
|
|
|
163
163
|
|
|
@@ -179,14 +179,11 @@ annotate my.Authors with {
|
|
|
179
179
|
// Languages List
|
|
180
180
|
//
|
|
181
181
|
annotate common.Languages with @(
|
|
182
|
-
Common.SemanticKey
|
|
183
|
-
Identification
|
|
184
|
-
UI
|
|
185
|
-
SelectionFields
|
|
186
|
-
|
|
187
|
-
descr
|
|
188
|
-
],
|
|
189
|
-
LineItem : [
|
|
182
|
+
Common.SemanticKey: [code],
|
|
183
|
+
Identification: [{ Value: code }],
|
|
184
|
+
UI: {
|
|
185
|
+
SelectionFields: [ name, descr ],
|
|
186
|
+
LineItem: [
|
|
190
187
|
{ Value: code },
|
|
191
188
|
{ Value: name },
|
|
192
189
|
],
|
|
@@ -198,18 +195,18 @@ annotate common.Languages with @(
|
|
|
198
195
|
// Language Details
|
|
199
196
|
//
|
|
200
197
|
annotate common.Languages with @(UI : {
|
|
201
|
-
HeaderInfo
|
|
202
|
-
TypeName
|
|
203
|
-
TypeNamePlural
|
|
204
|
-
Title
|
|
205
|
-
Description
|
|
198
|
+
HeaderInfo: {
|
|
199
|
+
TypeName : '{i18n>Language}',
|
|
200
|
+
TypeNamePlural: '{i18n>Languages}',
|
|
201
|
+
Title : { Value: name },
|
|
202
|
+
Description : { Value: descr }
|
|
206
203
|
},
|
|
207
|
-
Facets
|
|
208
|
-
$Type
|
|
209
|
-
Label
|
|
210
|
-
Target
|
|
204
|
+
Facets: [{
|
|
205
|
+
$Type : 'UI.ReferenceFacet',
|
|
206
|
+
Label : '{i18n>Details}',
|
|
207
|
+
Target: '@UI.FieldGroup#Details'
|
|
211
208
|
}, ],
|
|
212
|
-
FieldGroup #Details
|
|
209
|
+
FieldGroup #Details: {Data : [
|
|
213
210
|
{ Value: code },
|
|
214
211
|
{ Value: name },
|
|
215
212
|
{ Value: descr }
|
|
@@ -221,14 +218,14 @@ annotate common.Languages with @(UI : {
|
|
|
221
218
|
// Currencies List
|
|
222
219
|
//
|
|
223
220
|
annotate common.Currencies with @(
|
|
224
|
-
Common.SemanticKey
|
|
225
|
-
Identification
|
|
226
|
-
UI
|
|
227
|
-
SelectionFields
|
|
221
|
+
Common.SemanticKey: [code],
|
|
222
|
+
Identification: [{ Value: code}],
|
|
223
|
+
UI: {
|
|
224
|
+
SelectionFields: [
|
|
228
225
|
name,
|
|
229
226
|
descr
|
|
230
227
|
],
|
|
231
|
-
LineItem
|
|
228
|
+
LineItem: [
|
|
232
229
|
{ Value: descr },
|
|
233
230
|
{ Value: symbol },
|
|
234
231
|
{ Value: code },
|
|
@@ -241,20 +238,20 @@ annotate common.Currencies with @(
|
|
|
241
238
|
// Currency Details
|
|
242
239
|
//
|
|
243
240
|
annotate common.Currencies with @(UI : {
|
|
244
|
-
HeaderInfo
|
|
245
|
-
TypeName
|
|
246
|
-
TypeNamePlural
|
|
247
|
-
Title
|
|
248
|
-
Description
|
|
241
|
+
HeaderInfo: {
|
|
242
|
+
TypeName : '{i18n>Currency}',
|
|
243
|
+
TypeNamePlural: '{i18n>Currencies}',
|
|
244
|
+
Title : { Value: descr },
|
|
245
|
+
Description : { Value: code }
|
|
249
246
|
},
|
|
250
|
-
Facets
|
|
247
|
+
Facets: [
|
|
251
248
|
{
|
|
252
|
-
$Type
|
|
253
|
-
Label
|
|
254
|
-
Target
|
|
249
|
+
$Type : 'UI.ReferenceFacet',
|
|
250
|
+
Label : '{i18n>Details}',
|
|
251
|
+
Target: '@UI.FieldGroup#Details'
|
|
255
252
|
}
|
|
256
253
|
],
|
|
257
|
-
FieldGroup #Details
|
|
254
|
+
FieldGroup #Details: {Data : [
|
|
258
255
|
{ Value: name },
|
|
259
256
|
{ Value: symbol },
|
|
260
257
|
{ Value: code },
|
|
@@ -6,7 +6,7 @@ const { copyFiles } = require('../../util/template')
|
|
|
6
6
|
module.exports = class SampleTemplate extends require('../templateBase') {
|
|
7
7
|
|
|
8
8
|
async canRun() {
|
|
9
|
-
const { isJava } = await readProject(
|
|
9
|
+
const { isJava } = await readProject()
|
|
10
10
|
if (isJava) throw `'cds add sample' is not available for Java yet`
|
|
11
11
|
return true
|
|
12
12
|
}
|
|
@@ -14,11 +14,12 @@ module.exports = class SampleTemplate extends require('../templateBase') {
|
|
|
14
14
|
async run() {
|
|
15
15
|
const { db, srv, app } = (await this.getEnv()).folders
|
|
16
16
|
const language = exists('pom.xml') ? 'java' : 'nodejs'
|
|
17
|
+
const { force } = cds.cli.options
|
|
17
18
|
await Promise.all([
|
|
18
|
-
copyFiles(join(__dirname, 'files', 'db'), db, {},
|
|
19
|
-
copyFiles(join(__dirname, 'files', 'app'), app, {},
|
|
20
|
-
copyFiles(join(__dirname, 'files', 'srv'), srv, {},
|
|
21
|
-
copyFiles(join(__dirname, 'files', language), srv, {},
|
|
19
|
+
copyFiles(join(__dirname, 'files', 'db'), db, {}, force),
|
|
20
|
+
copyFiles(join(__dirname, 'files', 'app'), app, {}, force),
|
|
21
|
+
copyFiles(join(__dirname, 'files', 'srv'), srv, {}, force),
|
|
22
|
+
copyFiles(join(__dirname, 'files', language), srv, {}, force)
|
|
22
23
|
])
|
|
23
24
|
}
|
|
24
25
|
}
|
|
@@ -7,7 +7,7 @@ const { mergeJSON } = require('../../util/merge')
|
|
|
7
7
|
module.exports = class SQLiteTemplate extends require('../templateBase') {
|
|
8
8
|
|
|
9
9
|
async run() {
|
|
10
|
-
const project = await readProject(
|
|
10
|
+
const project = await readProject()
|
|
11
11
|
const { configFile } = project
|
|
12
12
|
project.shortcut = !(await read(configFile)).cds?.requires?.db?.kind
|
|
13
13
|
await mergeJSON(configFile, join(__dirname, 'files', `package.json.hbs`), project)
|
|
@@ -1,25 +1,14 @@
|
|
|
1
|
-
const cds = require('../../cds')
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
const { PROJECT_TYPE } = require('../constants');
|
|
5
|
-
const { exists } = require('../../cds').utils;
|
|
1
|
+
const cds = require('../../cds')
|
|
2
|
+
const { exists } = require('../../cds').utils
|
|
3
|
+
const { PROJECT_TYPE } = require('../constants')
|
|
6
4
|
|
|
7
5
|
module.exports = class TemplateBase {
|
|
6
|
+
|
|
8
7
|
/**
|
|
9
8
|
* @constructor
|
|
10
9
|
*/
|
|
11
|
-
constructor(
|
|
12
|
-
if (generator.options?.for && typeof generator.options?.for !== 'string') {
|
|
13
|
-
throw new Error('The --for argument must not be empty.')
|
|
14
|
-
}
|
|
15
|
-
this.projectPath = cds.root;
|
|
16
|
-
this.options = generator.options || {};
|
|
17
|
-
this.generator = generator;
|
|
10
|
+
constructor() {
|
|
18
11
|
this.name = this.constructor.name.replace(/template/i, '').replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase()
|
|
19
|
-
|
|
20
|
-
this.cwd = this.options.cwd || process.cwd();
|
|
21
|
-
|
|
22
|
-
this.projectName = path.basename(cds.root);
|
|
23
12
|
}
|
|
24
13
|
|
|
25
14
|
/**
|
|
@@ -51,7 +40,7 @@ module.exports = class TemplateBase {
|
|
|
51
40
|
}
|
|
52
41
|
|
|
53
42
|
// eslint-disable-next-line no-unused-vars
|
|
54
|
-
static hasFacet(env
|
|
43
|
+
static hasFacet(env) {
|
|
55
44
|
return true;
|
|
56
45
|
}
|
|
57
46
|
|
|
@@ -85,13 +74,14 @@ module.exports = class TemplateBase {
|
|
|
85
74
|
}
|
|
86
75
|
|
|
87
76
|
/**
|
|
77
|
+
* @abstract
|
|
88
78
|
* Executes steps for related facets that are set up for the project.
|
|
89
79
|
*/
|
|
90
80
|
async runRelatedMerging() {
|
|
91
81
|
for (const facet of this.getRelatedFacets()) {
|
|
92
82
|
const Template = require('./'+facet)
|
|
93
|
-
const template = new Template(
|
|
94
|
-
if (Template.hasFacet(await this.getEnv()
|
|
83
|
+
const template = new Template()
|
|
84
|
+
if (Template.hasFacet(await this.getEnv())) await template.runDependentMerging()
|
|
95
85
|
}
|
|
96
86
|
}
|
|
97
87
|
|
|
@@ -16,15 +16,15 @@ module.exports = class TinySampleTemplate extends require('../templateBase') {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
async _addJavaSamples() {
|
|
19
|
-
if (!
|
|
20
|
-
const mvnAddSamplesArgs = mvnArchetypes.getAddSamplesCmdArgs(
|
|
19
|
+
if (!cds.cli.options.add.has(JAVA)) {
|
|
20
|
+
const mvnAddSamplesArgs = mvnArchetypes.getAddSamplesCmdArgs()
|
|
21
21
|
try {
|
|
22
22
|
await commandUtil.spawnCommand('mvn', mvnAddSamplesArgs, { cwd: cds.root })
|
|
23
|
-
const mvnAddTestsArgs = mvnArchetypes.getAddTestsCmdArgs(
|
|
23
|
+
const mvnAddTestsArgs = mvnArchetypes.getAddTestsCmdArgs()
|
|
24
24
|
await commandUtil.spawnCommand('mvn', mvnAddTestsArgs, { cwd: cds.root })
|
|
25
25
|
} catch (err) {
|
|
26
26
|
if (err.code === 'ENOENT' && err.path === 'mvn') {
|
|
27
|
-
throw
|
|
27
|
+
throw `Maven executable 'mvn' not found, follow ${term.info(URLS.MAVEN_INSTALL_HELP)} and install Maven on your machine.`
|
|
28
28
|
}
|
|
29
29
|
throw err
|
|
30
30
|
}
|
|
@@ -33,7 +33,7 @@ module.exports = class TinySampleTemplate extends require('../templateBase') {
|
|
|
33
33
|
|
|
34
34
|
async _addNodejsSamples() {
|
|
35
35
|
const { db, srv } = (await this.getEnv()).folders
|
|
36
|
-
await copyFiles(join(__dirname, 'files', 'nodejs', 'db'), db, {},
|
|
37
|
-
await copyFiles(join(__dirname, 'files', 'nodejs', 'srv'), srv, { dbFolder: db.replace(/[\\/]+$/, '') },
|
|
36
|
+
await copyFiles(join(__dirname, 'files', 'nodejs', 'db'), db, {}, cds.cli.options.force)
|
|
37
|
+
await copyFiles(join(__dirname, 'files', 'nodejs', 'srv'), srv, { dbFolder: db.replace(/[\\/]+$/, '') }, cds.cli.options.force)
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -9,10 +9,9 @@ module.exports = class TogglesTemplate extends require('../templateBase') {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
async run() {
|
|
12
|
-
const project = await readProject(
|
|
12
|
+
const project = await readProject()
|
|
13
13
|
const { isNodejs , configFile} = project
|
|
14
14
|
await mergeJSON(configFile, join(__dirname, 'files', 'package.json.hbs'), project)
|
|
15
15
|
if (isNodejs) await sort('package.json', 'dependencies')
|
|
16
|
-
await this.runDependentMerging()
|
|
17
16
|
}
|
|
18
17
|
}
|
|
@@ -7,7 +7,7 @@ const { exists, read } = require('../../../cds').utils
|
|
|
7
7
|
|
|
8
8
|
module.exports = class TyperTemplate extends require('../templateBase') {
|
|
9
9
|
async canRun() {
|
|
10
|
-
const { isJava } = await readProject(
|
|
10
|
+
const { isJava } = await readProject()
|
|
11
11
|
if (isJava) {
|
|
12
12
|
console.warn(warn(`This appears to be a Java project. 'cds add ${TYPER}' is intended to be used in Node.js projects. Proceeding anyway.\n`))
|
|
13
13
|
}
|