@sap/cds-dk 8.8.1 → 8.9.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/CHANGELOG.md +30 -1
- package/bin/deploy/index.js +7 -3
- package/bin/init.js +5 -5
- package/bin/repl.js +4 -0
- package/bin/test.js +6 -4
- package/bin/up.js +77 -0
- package/bin/watch.js +0 -43
- package/lib/bind/shared.js +1 -1
- package/lib/build/buildTaskEngine.js +10 -9
- package/lib/build/buildTaskFactory.js +0 -45
- package/lib/build/plugins/helm/files/subcharts/content-deployment/Chart.yaml +1 -1
- package/lib/build/plugins/helm/files/subcharts/content-deployment/templates/job.yaml +8 -0
- package/lib/build/plugins/helm/files/subcharts/content-deployment/values.schema.json +87 -0
- package/lib/build/plugins/helm/files/subcharts/content-deployment/values.yaml +29 -1
- package/lib/build/plugins/helm/files/subcharts/service-instance/Chart.yaml +1 -1
- package/lib/build/plugins/helm/files/subcharts/service-instance/templates/serviceinstance.yaml +1 -0
- package/lib/build/plugins/helm/files/subcharts/service-instance/values.yaml +1 -1
- package/lib/build/plugins/helm/files/subcharts/web-application/Chart.yaml +1 -1
- package/lib/build/plugins/helm/files/subcharts/web-application/templates/deployment.yaml +8 -0
- package/lib/build/plugins/helm/files/subcharts/web-application/values.schema.json +87 -0
- package/lib/build/plugins/helm/files/subcharts/web-application/values.yaml +29 -1
- package/lib/build/provider/internalBuildTaskProvider.js +1 -1
- package/lib/build/provider/mtx-extension/index.js +5 -0
- package/lib/deploy/to-hana/hana.js +95 -43
- package/lib/deploy/to-hana/mtaUtil.js +1 -2
- package/lib/env/schema.js +12 -88
- package/lib/import/common.js +23 -15
- package/lib/import/odata.package.json +7 -0
- package/lib/init/constants.js +2 -1
- package/lib/init/index.js +13 -16
- package/lib/init/mvn.js +1 -1
- package/lib/init/plugin.js +1 -1
- package/lib/init/projectReader.js +5 -1
- package/lib/init/template/approuter/files/package.json +1 -4
- package/lib/init/template/attachments/files/package.json.hbs +1 -1
- package/lib/init/template/cloud-logging/files/java-cdsrc.json +5 -0
- package/lib/init/template/cloud-logging/index.js +9 -5
- package/lib/init/template/containerize/files/containerize.yaml.hbs +1 -1
- package/lib/init/template/data/index.js +3 -3
- package/lib/init/template/extension/files/.base/index.cds +15 -0
- package/lib/init/template/extension/files/app/extension.cds.hbs +47 -0
- package/lib/init/template/extension/files/test/data/Authors.csv +4 -0
- package/lib/init/template/extension/files/test/data/my.bookshop-Books.csv +8 -0
- package/lib/init/template/extension/index.js +99 -0
- package/lib/init/template/handler/files/extension/handler.xs.hbs +10 -0
- package/lib/init/template/handler/files/extension/package.json +10 -0
- package/lib/init/template/handler/index.js +83 -20
- package/lib/init/template/http/index.js +3 -3
- package/lib/init/template/java/index.js +3 -3
- package/lib/init/template/mta/index.js +1 -1
- package/lib/init/template/nodejs/index.js +3 -3
- package/lib/init/template/pipeline/index.js +1 -1
- package/lib/init/template/sample/index.js +6 -0
- package/lib/init/template/typer/files/package.json +0 -3
- package/lib/init/template/typer/index.js +2 -2
- package/lib/init/validate.js +4 -7
- package/lib/mtx/pull.js +9 -1
- package/lib/util/question.js +24 -21
- package/npm-shrinkwrap.json +20 -20
- package/package.json +2 -2
- /package/lib/init/template/handler/files/{handler.xs.hbs → standard/handler.xs.hbs} +0 -0
|
@@ -13,6 +13,12 @@ module.exports = class SampleTemplate extends require('../../plugin') {
|
|
|
13
13
|
|
|
14
14
|
async run() {
|
|
15
15
|
const project = readProject()
|
|
16
|
+
|
|
17
|
+
if (project.extendsApp) { // for extension projects, delegate to extension generator
|
|
18
|
+
const ExtensionGenerator = require('../extension')
|
|
19
|
+
return new ExtensionGenerator().addSample()
|
|
20
|
+
}
|
|
21
|
+
|
|
16
22
|
const { db, srv, app } = env4('production').folders
|
|
17
23
|
|
|
18
24
|
switch (project.language) {
|
|
@@ -28,8 +28,8 @@ module.exports = class TyperTemplate extends require('../../plugin') {
|
|
|
28
28
|
}
|
|
29
29
|
await merge(template('package.json')).into('package.json')
|
|
30
30
|
await mergeGitignore('.gitignore', template('gitignore'))
|
|
31
|
-
console.log(dim(`
|
|
32
|
-
console.log(dim('
|
|
31
|
+
console.log(dim(` adding '@cds-models' to .gitignore to ignore generated types`)) // REVISIT: other facets are silent wrt. what they change
|
|
32
|
+
console.log(dim(' added new dependencies to the project. Run ') + bold('npm i') + dim(' to install.'))
|
|
33
33
|
try {
|
|
34
34
|
await merge(source).into(target)
|
|
35
35
|
} catch (e) {
|
package/lib/init/validate.js
CHANGED
|
@@ -5,10 +5,10 @@ const { exists } = cds.utils
|
|
|
5
5
|
const { bold } = require('../../lib/util/term')
|
|
6
6
|
|
|
7
7
|
module.exports.projectName = projectName => {
|
|
8
|
-
if (!projectName) throw '
|
|
8
|
+
if (!projectName) throw 'specify a project name'
|
|
9
9
|
const invalidChars = new Set(projectName.match(REGEX_PROJECT_NAME)) // remove duplicates
|
|
10
10
|
if (invalidChars.size > 0) {
|
|
11
|
-
throw `
|
|
11
|
+
throw `project name '${projectName}' contains at least one character ('${[...invalidChars]}') which is not supported in npm package names.
|
|
12
12
|
Specify a different project name by replacing characters with '_' or '-', for example '${projectName.replace(REGEX_PROJECT_NAME, '_')}' or '${projectName.replace(REGEX_PROJECT_NAME, '-')}'.`
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -16,12 +16,9 @@ Specify a different project name by replacing characters with '_' or '-', for ex
|
|
|
16
16
|
module.exports.projectFolder = cwd => {
|
|
17
17
|
const existingProjectFile = PROJECT_FILES.find(exists)
|
|
18
18
|
if (existingProjectFile) {
|
|
19
|
-
let message
|
|
20
19
|
if (cwd === cds.root) {
|
|
21
|
-
|
|
22
|
-
} else {
|
|
23
|
-
message = `You seem to be trying to initialize an existing project. Use a different project name instead.`
|
|
20
|
+
throw `project already initialized (existing ${existingProjectFile})\nuse ${bold('cds add')} to add more features`
|
|
24
21
|
}
|
|
25
|
-
throw
|
|
22
|
+
throw `project already initialized (existing ${existingProjectFile})\nuse a different project name instead`
|
|
26
23
|
}
|
|
27
24
|
}
|
package/lib/mtx/pull.js
CHANGED
|
@@ -138,11 +138,19 @@ module.exports = class Pull {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
getExtensionName() {
|
|
142
|
+
try {
|
|
143
|
+
return require(join(this.projectFolder, 'package.json')).name;
|
|
144
|
+
} catch (error) {
|
|
145
|
+
throw getMessage(`Extension project at ${this.projectFolder} is missing package.json file`, { error, command: 'push' });
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
141
149
|
async pullTgz() {
|
|
142
150
|
const pullUrl = `${(this.params.get('appUrl'))}/-/cds/extensibility/pull`;
|
|
143
151
|
const options = { ...this.params.get('reqAuth'), responseType: 'arraybuffer' };
|
|
144
152
|
|
|
145
|
-
return axios.post(pullUrl, {}, options)
|
|
153
|
+
return axios.post(pullUrl, { tag: this.getExtensionName() }, options)
|
|
146
154
|
.then(response => Buffer.from(response.data))
|
|
147
155
|
.catch(error => handleHttpError(error, this.params, { url: pullUrl }));
|
|
148
156
|
}
|
package/lib/util/question.js
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
const readline = require('readline')
|
|
1
|
+
const readline = require('node:readline')
|
|
2
|
+
|
|
2
3
|
async function ask4(...args) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
|
|
5
|
+
// If not in interactive mode, read all input at once.
|
|
6
|
+
if (!process.stdin.isTTY) {
|
|
7
|
+
const data = await new Promise(resolve => {
|
|
8
|
+
let result = ''
|
|
9
|
+
process.stdin.on('data', chunk => result += chunk)
|
|
10
|
+
process.stdin.on('end', () => resolve(result))
|
|
7
11
|
})
|
|
12
|
+
return data.split(/\r?\n/).slice(0, args.length)
|
|
13
|
+
}
|
|
8
14
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
rl.question(`${questionParam}`, function (answer) {
|
|
12
|
-
answers.push(answer);
|
|
13
|
-
resolve();
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
}
|
|
15
|
+
const answers = []
|
|
16
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout })
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const askQuestion = question =>
|
|
19
|
+
new Promise(resolve => rl.question(question, answer => {
|
|
20
|
+
answers.push(answer)
|
|
21
|
+
resolve()
|
|
22
|
+
}))
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
for (const question of args) {
|
|
25
|
+
await askQuestion(question)
|
|
26
|
+
}
|
|
27
|
+
rl.close()
|
|
28
|
+
return answers
|
|
24
29
|
}
|
|
25
30
|
|
|
26
|
-
module.exports = {
|
|
27
|
-
ask4
|
|
28
|
-
}
|
|
31
|
+
module.exports = { ask4 }
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap/cds-dk",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.9.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@sap/cds-dk",
|
|
9
|
-
"version": "8.
|
|
9
|
+
"version": "8.9.0",
|
|
10
10
|
"license": "SEE LICENSE IN LICENSE",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@cap-js/asyncapi": "^1.0.0",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@sap/cds": ">=7",
|
|
15
15
|
"@sap/cds-foss": "^5.0.0",
|
|
16
16
|
"@sap/cds-mtxs": ">=1.9.0",
|
|
17
|
-
"@sap/eslint-plugin-cds": "
|
|
17
|
+
"@sap/eslint-plugin-cds": ">=3.0.1",
|
|
18
18
|
"@sap/hdi-deploy": "^5",
|
|
19
19
|
"axios": "^1",
|
|
20
20
|
"eslint": "^9",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
"node_modules/@eslint/config-helpers": {
|
|
124
|
-
"version": "0.
|
|
124
|
+
"version": "0.2.0",
|
|
125
125
|
"license": "Apache-2.0",
|
|
126
126
|
"engines": {
|
|
127
127
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
}
|
|
139
139
|
},
|
|
140
140
|
"node_modules/@eslint/eslintrc": {
|
|
141
|
-
"version": "3.3.
|
|
141
|
+
"version": "3.3.1",
|
|
142
142
|
"license": "MIT",
|
|
143
143
|
"dependencies": {
|
|
144
144
|
"ajv": "^6.12.4",
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
}
|
|
160
160
|
},
|
|
161
161
|
"node_modules/@eslint/js": {
|
|
162
|
-
"version": "9.
|
|
162
|
+
"version": "9.23.0",
|
|
163
163
|
"license": "MIT",
|
|
164
164
|
"engines": {
|
|
165
165
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
}
|
|
236
236
|
},
|
|
237
237
|
"node_modules/@sap/cds": {
|
|
238
|
-
"version": "8.
|
|
238
|
+
"version": "8.9.0",
|
|
239
239
|
"license": "SEE LICENSE IN LICENSE",
|
|
240
240
|
"dependencies": {
|
|
241
241
|
"@sap/cds-compiler": ">=5.1",
|
|
@@ -245,13 +245,13 @@
|
|
|
245
245
|
"bin": {
|
|
246
246
|
"cds-deploy": "lib/dbs/cds-deploy.js",
|
|
247
247
|
"cds-serve": "bin/serve.js",
|
|
248
|
-
"cds-test": "bin/test.js"
|
|
249
|
-
"chest": "bin/test.js"
|
|
248
|
+
"cds-test": "bin/test.js"
|
|
250
249
|
},
|
|
251
250
|
"engines": {
|
|
252
251
|
"node": ">=18"
|
|
253
252
|
},
|
|
254
253
|
"peerDependencies": {
|
|
254
|
+
"@eslint/js": "^9",
|
|
255
255
|
"express": "^4",
|
|
256
256
|
"tar": "^7"
|
|
257
257
|
},
|
|
@@ -265,7 +265,7 @@
|
|
|
265
265
|
}
|
|
266
266
|
},
|
|
267
267
|
"node_modules/@sap/cds-compiler": {
|
|
268
|
-
"version": "5.
|
|
268
|
+
"version": "5.9.0",
|
|
269
269
|
"license": "SEE LICENSE IN LICENSE",
|
|
270
270
|
"dependencies": {
|
|
271
271
|
"antlr4": "4.9.3"
|
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
}
|
|
302
302
|
},
|
|
303
303
|
"node_modules/@sap/cds-mtxs": {
|
|
304
|
-
"version": "2.
|
|
304
|
+
"version": "2.7.0",
|
|
305
305
|
"license": "SEE LICENSE IN LICENSE",
|
|
306
306
|
"dependencies": {
|
|
307
307
|
"@sap/hdi-deploy": ">=4",
|
|
@@ -349,7 +349,7 @@
|
|
|
349
349
|
}
|
|
350
350
|
},
|
|
351
351
|
"node_modules/@sap/hdi-deploy": {
|
|
352
|
-
"version": "5.4.
|
|
352
|
+
"version": "5.4.2",
|
|
353
353
|
"license": "See LICENSE file",
|
|
354
354
|
"dependencies": {
|
|
355
355
|
"@sap/hdi": "^4.7.0",
|
|
@@ -388,7 +388,7 @@
|
|
|
388
388
|
}
|
|
389
389
|
},
|
|
390
390
|
"node_modules/@types/estree": {
|
|
391
|
-
"version": "1.0.
|
|
391
|
+
"version": "1.0.7",
|
|
392
392
|
"license": "MIT"
|
|
393
393
|
},
|
|
394
394
|
"node_modules/@types/json-schema": {
|
|
@@ -481,7 +481,7 @@
|
|
|
481
481
|
"license": "MIT"
|
|
482
482
|
},
|
|
483
483
|
"node_modules/axios": {
|
|
484
|
-
"version": "1.8.
|
|
484
|
+
"version": "1.8.4",
|
|
485
485
|
"license": "MIT",
|
|
486
486
|
"dependencies": {
|
|
487
487
|
"follow-redirects": "^1.15.6",
|
|
@@ -513,7 +513,7 @@
|
|
|
513
513
|
"optional": true
|
|
514
514
|
},
|
|
515
515
|
"node_modules/better-sqlite3": {
|
|
516
|
-
"version": "11.
|
|
516
|
+
"version": "11.9.1",
|
|
517
517
|
"hasInstallScript": true,
|
|
518
518
|
"license": "MIT",
|
|
519
519
|
"optional": true,
|
|
@@ -926,16 +926,16 @@
|
|
|
926
926
|
}
|
|
927
927
|
},
|
|
928
928
|
"node_modules/eslint": {
|
|
929
|
-
"version": "9.
|
|
929
|
+
"version": "9.23.0",
|
|
930
930
|
"license": "MIT",
|
|
931
931
|
"dependencies": {
|
|
932
932
|
"@eslint-community/eslint-utils": "^4.2.0",
|
|
933
933
|
"@eslint-community/regexpp": "^4.12.1",
|
|
934
934
|
"@eslint/config-array": "^0.19.2",
|
|
935
|
-
"@eslint/config-helpers": "^0.
|
|
935
|
+
"@eslint/config-helpers": "^0.2.0",
|
|
936
936
|
"@eslint/core": "^0.12.0",
|
|
937
|
-
"@eslint/eslintrc": "^3.3.
|
|
938
|
-
"@eslint/js": "9.
|
|
937
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
938
|
+
"@eslint/js": "9.23.0",
|
|
939
939
|
"@eslint/plugin-kit": "^0.2.7",
|
|
940
940
|
"@humanfs/node": "^0.16.6",
|
|
941
941
|
"@humanwhocodes/module-importer": "^1.0.1",
|
|
@@ -2476,7 +2476,7 @@
|
|
|
2476
2476
|
}
|
|
2477
2477
|
},
|
|
2478
2478
|
"node_modules/yaml": {
|
|
2479
|
-
"version": "2.7.
|
|
2479
|
+
"version": "2.7.1",
|
|
2480
2480
|
"license": "ISC",
|
|
2481
2481
|
"bin": {
|
|
2482
2482
|
"yaml": "bin.mjs"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap/cds-dk",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.9.0",
|
|
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": [
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@sap/cds": ">=7",
|
|
23
23
|
"@sap/cds-foss": "^5.0.0",
|
|
24
24
|
"@sap/cds-mtxs": ">=1.9.0",
|
|
25
|
-
"@sap/eslint-plugin-cds": "
|
|
25
|
+
"@sap/eslint-plugin-cds": ">=3.0.1",
|
|
26
26
|
"@sap/hdi-deploy": "^5",
|
|
27
27
|
"axios": "^1",
|
|
28
28
|
"eslint": "^9",
|
|
File without changes
|