From 0bf1d899de4c24d620bc2877e7f9a654bac08b46 Mon Sep 17 00:00:00 2001 From: Marika Marszalkowski Date: Mon, 25 May 2020 14:53:39 +0200 Subject: [PATCH] fix: Generation of aggregator package (#150) Co-authored-by: Junjie Tang <33489572+jjtang1985@users.noreply.github.com> --- CHANGELOG.md | 1 + packages/generator/src/aggregator-package/package-json.ts | 4 ++-- .../generator/test/aggregator-package/package-json.spec.ts | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 267b3477db..f1e7b3d380 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ ## Fixed Issues - Fix the OData client generator to avoid a compilation error when a complex type only contain complex types. +- Fix the dependency versions in the aggregator package generated by the OData client generator. # 1.20.1 diff --git a/packages/generator/src/aggregator-package/package-json.ts b/packages/generator/src/aggregator-package/package-json.ts index 9733f0d7d7..43f080d1e9 100644 --- a/packages/generator/src/aggregator-package/package-json.ts +++ b/packages/generator/src/aggregator-package/package-json.ts @@ -22,11 +22,11 @@ export function packageJson( version: 'node ../../../after-version-update.js' }, dependencies: dependencies.reduce((deps, service) => { - deps[service] = `^${generatorVersion}`; + deps[service] = `^${versionInPackageJson || generatorVersion}`; return deps; }, {}), peerDependencies: { - '@sap-cloud-sdk/core': `^${generatorVersion}` + '@sap-cloud-sdk/core': `^${versionInPackageJson || generatorVersion}` } }, null, diff --git a/packages/generator/test/aggregator-package/package-json.spec.ts b/packages/generator/test/aggregator-package/package-json.spec.ts index 47b88049bf..070a6af83f 100644 --- a/packages/generator/test/aggregator-package/package-json.spec.ts +++ b/packages/generator/test/aggregator-package/package-json.spec.ts @@ -26,11 +26,11 @@ describe('package-json', () => { ' "version": "node ../../../after-version-update.js"\n' + ' },\n' + ' "dependencies": {\n' + - ' "@sap/cloud-sdk-vdm-business-area-service": "^1.17.4-alpha.8",\n' + - ' "@sap/cloud-sdk-vdm-business-partner-service": "^1.17.4-alpha.8"\n' + + ' "@sap/cloud-sdk-vdm-business-area-service": "^2.0.0",\n' + + ' "@sap/cloud-sdk-vdm-business-partner-service": "^2.0.0"\n' + ' },\n' + ' "peerDependencies": {\n' + - ' "@sap-cloud-sdk/core": "^1.17.4-alpha.8"\n' + + ' "@sap-cloud-sdk/core": "^2.0.0"\n' + ' }\n' + '}\n'; expect(actual).toEqual(expected);