import { getConfig, setConfig } from "../config/index.js";
import { views as defaultViews } from "../react/server/paths/index.js";
export function getViews() {
    const config = getConfig();
    const { views = [] } = config;
    const includedPaths = views.map(view => view.path);
    const baseViews = defaultViews
        .filter(view => !includedPaths.includes(view.path));
    if (!baseViews.length)
        return views;
    const allViews = [...baseViews, ...views];
    // Next time getConfig is called, no base views will be included
    setConfig({ ...config, views: allViews });
    return [...baseViews, ...views];
}
export function getView(path) {
    const views = getViews();
    return views.find(view => view.path === path);
}
//# sourceMappingURL=views.js.map