2020-05-09 07:04:39 +00:00
|
|
|
import { Preset, PresetConfig } from '../common';
|
2020-04-29 12:45:51 +00:00
|
|
|
import * as configPreset from './config';
|
|
|
|
import * as defaultPreset from './default';
|
|
|
|
import * as dockerPreset from './docker';
|
|
|
|
import * as groupPreset from './group';
|
|
|
|
import * as helpersPreset from './helpers';
|
|
|
|
import * as monorepoPreset from './monorepo';
|
|
|
|
import * as packagesPreset from './packages';
|
|
|
|
import * as previewPreset from './preview';
|
|
|
|
import * as schedulePreset from './schedule';
|
|
|
|
|
|
|
|
export const groups: Record<string, Record<string, Preset>> = {
|
|
|
|
config: configPreset.presets,
|
|
|
|
default: defaultPreset.presets,
|
|
|
|
docker: dockerPreset.presets,
|
|
|
|
group: groupPreset.presets,
|
|
|
|
helpers: helpersPreset.presets,
|
|
|
|
monorepo: monorepoPreset.presets,
|
|
|
|
packages: packagesPreset.presets,
|
|
|
|
preview: previewPreset.presets,
|
|
|
|
schedule: schedulePreset.presets,
|
|
|
|
};
|
|
|
|
|
2020-05-09 07:04:39 +00:00
|
|
|
export function getPreset({
|
|
|
|
packageName: pkgName,
|
|
|
|
presetName,
|
|
|
|
}: PresetConfig): Preset | undefined {
|
|
|
|
return groups[pkgName]
|
|
|
|
? groups[pkgName][presetName]
|
|
|
|
: /* istanbul ignore next */ undefined;
|
2020-04-29 12:45:51 +00:00
|
|
|
}
|