mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-05-16 21:56:33 +00:00
The Node server's read path now goes through ~/.cache/webi/legacy/ only (see #1075). A handful of supporting tools and tests still carried references to the obsolete upstream-fetcher modules and the old year-month cache layout. Update them in place; the actual deletion of the orphaned modules follows in #1076. - _webi/classify-one.js — read from ~/.cache/webi/legacy/<pkg>.json instead of ../_cache/<yearMonth>/<pkg>.json. - _webi/builds-cacher-test.js — drop the bc.freshenRandomPackage(...) call; the freshener was removed when fetching went away. - _webi/builds.js — drop the //Releases: Releases stub comment. - _webi/lint-builds.js — drop two now-unused require()s. - _webi/test.js — adjust a single reference to the post-cleanup shape.
38 lines
980 B
JavaScript
38 lines
980 B
JavaScript
'use strict';
|
|
|
|
let Builds = module.exports;
|
|
|
|
let Path = require('node:path');
|
|
|
|
let BuildsCacher = require('./builds-cacher.js');
|
|
// let HostTargets = require('./build-classifier/host-targets.js');
|
|
let Parallel = require('./parallel.js');
|
|
|
|
var INSTALLERS_DIR = Path.join(__dirname, '..');
|
|
var CACHE_DIR = Path.join(__dirname, '../_cache');
|
|
|
|
let bc = BuildsCacher.create({
|
|
caches: CACHE_DIR,
|
|
installers: INSTALLERS_DIR,
|
|
});
|
|
|
|
Builds.init = async function () {
|
|
let dirs = await bc.getProjectsByType();
|
|
let projNames = Object.keys(dirs.valid);
|
|
|
|
let parallel = 25;
|
|
await Parallel.run(parallel, projNames, getAll);
|
|
async function getAll(name) {
|
|
void (await bc.getPackages({
|
|
name: name,
|
|
date: new Date(),
|
|
}));
|
|
}
|
|
};
|
|
|
|
Builds.enumerateLatestVersions = bc.enumerateLatestVersions;
|
|
Builds.findMatchingPackages = bc.findMatchingPackages;
|
|
Builds.getPackage = bc.getPackages;
|
|
Builds.getProjectType = bc.getProjectType;
|
|
Builds.selectPackage = bc.selectPackage;
|