debug bowser addition

This commit is contained in:
Calum McConnell 2021-04-27 23:01:46 -04:00
parent f72a3e2c30
commit 2f7d67184e
No known key found for this signature in database
GPG Key ID: EFF5E1D7E0CD9B32
4 changed files with 18 additions and 14 deletions

View File

@ -473,8 +473,7 @@ mappings.cdn = {
'bootstrap-vue@{version}/dist/bootstrap-vue.css': resources.bootstrapVueCSS,
'bootstrap-vue@{version}/dist/bootstrap-vue.min.js': resources.bootstrapVueJS,
'bootstrap-vue@{version}/dist/bootstrap-vue.js': resources.bootstrapVueJS,
'bowser@{version}/bundled.js' : resources.bowserJS,
'bowser@{version}/es5.js' : resources.bowserJS,
'bowser@{version}/': resources.bowserJS,
'bulma@{version}/css/bulma.': resources.bulma,
'chart.js@{version}': resources.chartJs,
'clipboard@{version}/dist/clipboard.': resources.clipboardJS,

View File

@ -125,12 +125,19 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
});
resourcePath = channelPath.replace(basePath, '');
if (Resource.SINGLE_NUMBER_EXPRESSION.test(channelPath)) {
versionNumber = channelPath.match(/\d/);
resourcePattern = resourcePath.replace(versionNumber, Resource.VERSION_PLACEHOLDER);
versionNumber = [`${versionNumber}.0`];
} else {
versionNumber = resourcePath.match(Resource.VERSION_EXPRESSION);
// Evaluate first in case of version 'latest' and numerals in resource
versionNumber = resourcePath.match(Resource.VERSION_EXPRESSION);
// Handle weird version expressions
if(!versionNumber){
if (Resource.SINGLE_NUMBER_EXPRESSION.test(channelPath)) {
versionNumber = channelPath.match(/\d/);
resourcePattern = resourcePath.replace(versionNumber, Resource.VERSION_PLACEHOLDER);
versionNumber = [`${versionNumber}.0`];
}
}
else {
resourcePattern = resourcePath.replace(versionNumber, Resource.VERSION_PLACEHOLDER);
}
@ -142,11 +149,10 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
}
return shorthandResource;
}
for (let resourceMold of Object.keys(resourceMappings)) {
if (resourcePattern.startsWith(resourceMold)) {
let targetPath, versionDelivered, versionRequested, bundle;
targetPath = resourceMappings[resourceMold].path;
targetPath = targetPath.replace(Resource.VERSION_PLACEHOLDER, versionNumber);
// Replace the requested version with the latest depending on major version

View File

@ -253,8 +253,8 @@ var resources = {
'path': 'resources/bootstrap-vue/{version}/bootstrap-vue.min.css'
},
// Bowser.js
'bowserJs': {
'path': 'resources/bowser/{version}/bundled.min.jsm'
'bowserJS': {
'path': 'resources/bowser/{version}/bowser.min.jsm'
},
// Bulma
'bulma': {

View File

@ -205,9 +205,8 @@ targets.setLastVersion = function (type, version) {
return '2.21.2';
} else if (type.startsWith('/bootstrap-3-typeahead/4.')) {
return '4.0.2';
} else if (type.startsWith('/bowser/2.')) {
} else if (type.startsWith('/bowser/')) {
return '2.11.0'
}
} else if (type.startsWith('/bulma/0.')) {
return '0.9.2';
} else if (type.startsWith('/Chart.js/2.')) {