Load layouts and optional features from staged asset caches
This commit is contained in:
@@ -10,11 +10,13 @@
|
||||
}
|
||||
|
||||
function blocking(manifest, previous, activeLayout) {
|
||||
return [...new Set(Object.entries(manifest.groups)
|
||||
const names = new Set(Object.entries(manifest.groups)
|
||||
.filter(([name, group]) => name === 'core' || !group.background ||
|
||||
name === 'layout:' + activeLayout ||
|
||||
(previous?.groups[name] && previous.groups[name].contract !== group.contract))
|
||||
.flatMap(([, group]) => group.files))].sort();
|
||||
.map(([name]) => name));
|
||||
for (const name of names) for (const dependency of manifest.groups[name].dependencies || []) names.add(dependency);
|
||||
return [...new Set([...names].flatMap(name => manifest.groups[name].files))].sort();
|
||||
}
|
||||
|
||||
function plan(manifest, keys) {
|
||||
@@ -26,9 +28,10 @@
|
||||
}
|
||||
|
||||
function retained(current, previous) {
|
||||
const keep = new Set(paths(current).map(path => url(path, current.files[path])));
|
||||
const currentPaths = new Set(paths(current));
|
||||
const keep = new Set([...currentPaths].map(path => url(path, current.files[path])));
|
||||
if (previous) for (const path of paths(previous)) {
|
||||
if (current.files[path]?.h !== previous.files[path].h) keep.add(url(path, previous.files[path]));
|
||||
if (!currentPaths.has(path) || current.files[path]?.h !== previous.files[path].h) keep.add(url(path, previous.files[path]));
|
||||
}
|
||||
return keep;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user