UNPKG

@featurevisor/core

Version:

Core package of Featurevisor for Node.js usage

54 lines (53 loc) 2.26 kB
import type { BucketBy } from "@featurevisor/types"; import { Parser } from "./parsers"; import type { Plugin } from "../cli"; export declare const FEATURES_DIRECTORY_NAME = "features"; export declare const SEGMENTS_DIRECTORY_NAME = "segments"; export declare const ATTRIBUTES_DIRECTORY_NAME = "attributes"; export declare const GROUPS_DIRECTORY_NAME = "groups"; export declare const TESTS_DIRECTORY_NAME = "tests"; export declare const STATE_DIRECTORY_NAME = ".featurevisor"; export declare const DATAFILES_DIRECTORY_NAME = "datafiles"; export declare const DATAFILE_NAME_PATTERN = "featurevisor-%s.json"; export declare const SITE_EXPORT_DIRECTORY_NAME = "out"; export declare const CONFIG_MODULE_NAME = "featurevisor.config.js"; export declare const ROOT_DIR_PLACEHOLDER = "<rootDir>"; export declare const DEFAULT_ENVIRONMENTS: string[]; export declare const DEFAULT_TAGS: string[]; export declare const DEFAULT_BUCKET_BY_ATTRIBUTE = "userId"; export declare const DEFAULT_PRETTY_STATE = true; export declare const DEFAULT_PRETTY_DATAFILE = false; export declare const DEFAULT_PARSER: Parser; export declare const SCHEMA_VERSION = "2"; export interface ProjectConfig { featuresDirectoryPath: string; segmentsDirectoryPath: string; attributesDirectoryPath: string; groupsDirectoryPath: string; testsDirectoryPath: string; stateDirectoryPath: string; datafilesDirectoryPath: string; datafileNamePattern: string; siteExportDirectoryPath: string; environments: string[] | false; tags: string[]; adapter: any; plugins: Plugin[]; defaultBucketBy: BucketBy; parser: Parser; prettyState: boolean; prettyDatafile: boolean; stringify: boolean; enforceCatchAllRule?: boolean; maxVariableStringLength?: number; maxVariableArrayStringifiedLength?: number; maxVariableObjectStringifiedLength?: number; maxVariableJSONStringifiedLength?: number; } export declare function getProjectConfig(rootDirectoryPath: string): ProjectConfig; export interface ShowProjectConfigOptions { json?: boolean; pretty?: boolean; } export declare function showProjectConfig(projectConfig: ProjectConfig, options?: ShowProjectConfigOptions): void; export declare const configPlugin: Plugin;