1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2024-12-23 08:30:38 +01:00

Improved: Determination of latest versions (#194)

This commit is contained in:
nobody 2020-12-08 19:49:09 +01:00
parent 6d624a30ae
commit ac7f1cf4d7
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
3 changed files with 10 additions and 11 deletions

View File

@ -55,7 +55,7 @@ const MessageResponse = {
const Resource = {
'MAPPING_EXPRESSION': /\.map$/i,
'VERSION_EXPRESSION': /(?:\d{1,2}\.){1,3}\d{1,2}/,
'VERSION_EXPRESSION': /(?:\d{1,2}\.){1,3}\d{1,2}|latest/,
'SINGLE_NUMBER_EXPRESSION': /^\D+\d\D+$/,
'VERSION_PLACEHOLDER': '{version}'
};

View File

@ -400,7 +400,6 @@ mappings.cdn = {
'code.jquery.com': {
'/': {
'jquery-{version}.': resources.jQuery,
'jquery-latest.': resources.jQuery,
'ui/{version}/jquery-ui.': resources.jQueryUI,
'mobile/{version}/jquery.mobile': resources.jQueryMobile
}
@ -446,7 +445,7 @@ mappings.cdn = {
'font-awesome@{version}/css/font-awesome.': resources.fontawesome,
'hls.js/dist/hls.min.js': resources.hlsJS,
'history@{version}/umd/history.min.js': resources.history,
'hls.js@latest': resources.hlsJS,
'hls.js@{version}': resources.hlsJS,
'instantsearch.js@{version}/dist/instantsearch.production.': resources.InstantSearchJS,
'jquery@{version}/dist/jquery.': resources.jQuery,
'jquery@{version}/dist/jquery.min.': resources.jQuery,
@ -468,8 +467,8 @@ mappings.cdn = {
'react-router@{version}/umd/react-router.': resources.reactRouter,
'react-side-effect@{version}/lib/index.umd.': resources.reactSideEffect,
'react-lifecycles-compat@{version}/react-lifecycles-compat.': resources.reactLifecyclesCompat,
'p2p-media-loader-core@latest/build/p2p-media-loader-core.min.js': resources.p2pMediaLoaderCore,
'p2p-media-loader-hlsjs@latest/build/p2p-media-loader-hlsjs.min.js': resources.p2pMediaLoaderHlsJS,
'p2p-media-loader-core@{version}/build/p2p-media-loader-core.min.js': resources.p2pMediaLoaderCore,
'p2p-media-loader-hlsjs@{version}/build/p2p-media-loader-hlsjs.min.js': resources.p2pMediaLoaderHlsJS,
'p5@{version}/lib/p5.': resources.p5JS,
'p5@{version}/lib/addons/p5.sound.': resources.p5JSsound,
'popper.js@{version}/dist/umd/popper.': resources.popperJS,
@ -530,10 +529,10 @@ mappings.cdn = {
'momentjs/{version}/moment.': resources.moment,
'momentjs/{version}/moment.min.': resources.moment,
'mootools/{version}/mootools-': resources.mootools,
'simplemde/latest/simplemde.js': resources.simplemdeJS,
'simplemde/latest/simplemde.min.js': resources.simplemdeJS,
'simplemde/latest/simplemde.css': resources.simplemdeCSS,
'simplemde/latest/simplemde.min.css': resources.simplemdeCSS,
'simplemde/{version}/simplemde.js': resources.simplemdeJS,
'simplemde/{version}/simplemde.min.js': resources.simplemdeJS,
'simplemde/{version}/simplemde.css': resources.simplemdeCSS,
'simplemde/{version}/simplemde.min.css': resources.simplemdeCSS,
'swfobject/{version}/swfobject.': resources.swfobject,
'underscorejs/{version}/underscore.': resources.underscore,
'underscorejs/{version}/underscore-min.': resources.underscore,

View File

@ -169,7 +169,7 @@ targets.setLastVersion = function (type, version) {
return '6.3.0';
} else if (type.startsWith('/d3-legend/2.')) {
return '2.25.6';
} else if (type.startsWith('/dexie/3.')) {
} else if (type.startsWith('/dexie/3.') || type.startsWith('/dexie/latest') ) {
return '3.0.3';
} else if (type.startsWith('/dojo/1.')) {
return '1.16.3';
@ -235,7 +235,7 @@ targets.setLastVersion = function (type, version) {
else return '1.12.4'; // > 1.11.3
} else if (type.startsWith('/jquery/2.')) {
return '2.2.4';
} else if (type.startsWith('/jquery/3.') || type.startsWith('/jquery/null')) {
} else if (type.startsWith('/jquery/3.') || type.startsWith('/jquery/latest')) {
return '3.5.1';
} else if (type.startsWith('/jquery.devbridge-autocomplete/1.')) {
return '1.4.11';