feat(supported-version): dynamically compute (#120)

Previously, I maintained supported versions by revising a file of versions. This was monotonous, like time.

Now, these are just based upon the documented EoL dates of the versions published by Magento.
This commit is contained in:
Damien Retzinger
2023-01-09 13:09:24 -05:00
committed by GitHub
parent c0390c8abd
commit dbc889f7ce
8 changed files with 95 additions and 46 deletions
@@ -1,18 +1,18 @@
import { getMatrixForVersions } from "./get-matrix-for-versions";
import latestJson from '../kind/latest.json';
import currentlySupportedJson from '../kind/currently-supported.json';
import allVersions from '../versions/individual.json';
import nightly from '../kind/nightly.json';
import { amendMatrixForNext } from "../nightly/get-next-version";
import { getDayBefore } from '../nightly/get-day-before';
import { getCurrentlySupportedVersions } from "../kind/get-currently-supported";
export const getMatrixForKind = (kind: string, versions: string = "") => {
export const getMatrixForKind = (kind: string, versions = "") => {
switch(kind){
case 'latest':
return getMatrixForVersions(latestJson);
case 'currently-supported':
return getMatrixForVersions(currentlySupportedJson);
return getMatrixForVersions(getCurrentlySupportedVersions(new Date()));
case 'nightly':
return amendMatrixForNext(getMatrixForVersions(nightly), 'https://upstream-mirror.mage-os.org', getDayBefore());
case 'all':