From d5935f8cea1999448178df68e488327a3e5d1f89 Mon Sep 17 00:00:00 2001 From: venetrius Date: Thu, 7 Nov 2024 09:41:59 +0100 Subject: [PATCH] chore(webapps): add NES version for angularjs-essentials libs related to: #4549 --- webapps/frontend/package.json | 31 +++++++++++++++---------------- webapps/frontend/scripts/xlts.js | 32 +++++++++++++++++++++----------- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/webapps/frontend/package.json b/webapps/frontend/package.json index 65aa1ab5d38..e5533b6ed24 100644 --- a/webapps/frontend/package.json +++ b/webapps/frontend/package.json @@ -101,24 +101,23 @@ }, "xlts": { "angular": { - "xltsVersion": "1.9.7", - "dependencies": [ - "angular", - "angular-animate", - "angular-cookies", - "angular-loader", - "angular-resource", - "angular-route", - "angular-sanitize", - "angular-touch", - "angular-mocks" - ] + "angular": "1.9.7", + "angular-animate": "1.9.7", + "angular-cookies": "1.9.7", + "angular-loader": "1.9.7", + "angular-resource": "1.9.7", + "angular-route": "1.9.7", + "angular-sanitize": "1.9.7", + "angular-touch": "1.9.7", + "angular-mocks": "1.9.7" }, "bootstrap": { - "xltsVersion": "3.4.5", - "dependencies": [ - "bootstrap" - ] + "bootstrap": "3.4.5" + }, + "angularjs-essentials": { + "angular-ui-bootstrap": "2.5.7", + "angular-translate": "2.20.3", + "angular-moment": "1.3.2" } } } diff --git a/webapps/frontend/scripts/xlts.js b/webapps/frontend/scripts/xlts.js index 76a8891e3e8..32322b10742 100755 --- a/webapps/frontend/scripts/xlts.js +++ b/webapps/frontend/scripts/xlts.js @@ -33,14 +33,26 @@ const exec = (cmd, successMsg) => { }).toString(); }; +// These are the last supported versions for these packages ????? +const baseVersions = { + 'angular-translate': '2.19.1', + 'angular-moment': '1.3.0', + 'angular-ui-bootstrap': '2.5.6' +}; + const getDependencyVersion = (nameSpace, npmPackage, xltsVersion) => { - if (nameSpace !== 'angular') { - return `${npmPackage}@npm:@${scope}/${npmPackage}@${xltsVersion}`; + if (nameSpace === 'angularjs-essentials') { + const baseVersion = baseVersions[npmPackage]; + return `${npmPackage}@npm:@${scope}/${nameSpace}@${baseVersion}-${npmPackage}-${xltsVersion}`; + } + + if (nameSpace === 'angular') { + const versionPostfix = + npmPackage === 'angular' ? '' : '-' + npmPackage.split('-')[1]; + return `${npmPackage}@npm:@${scope}/angularjs@${xltsVersion}${versionPostfix}`; } - let versionPostfix = npmPackage.split('-')[1] || ''; - versionPostfix = versionPostfix ? '-' + versionPostfix : ''; - return `${npmPackage}@npm:@${scope}/angularjs@${xltsVersion}${versionPostfix}`; + return `${npmPackage}@npm:@${scope}/${npmPackage}@${xltsVersion}`; }; const registryConfigured = exec(`npm get @${scope}:registry`) !== 'undefined\n'; @@ -66,12 +78,10 @@ if ( const xlts = require('../package.json').xlts; const npmPackages = Object.entries(xlts) - .map(([nameSpace, settings]) => - settings.dependencies - .map(npmPackage => - getDependencyVersion(nameSpace, npmPackage, settings.xltsVersion) - ) - .join(' ') + .flatMap(([nameSpace, settings]) => + Object.entries(settings).map(([npmPackage, version]) => + getDependencyVersion(nameSpace, npmPackage, version) + ) ) .join(' ');