UNPKG

@warp-drive/build-config

Version:

Provides Build Configuration for projects using WarpDrive or EmberData

102 lines (101 loc) 2.64 kB
import { getDeprecations } from "./-private/utils/deprecations.js"; import { getFeatures } from "./-private/utils/features.js"; import * as LOGGING from "./debugging.js"; export type WarpDriveConfig = { /** * An object of key/value pairs of logging flags * * see {@link LOGGING | debugging} for the available flags. * * ```ts * { * LOG_CACHE: true, * } * ``` * * @public */ debug?: Partial<InternalWarpDriveConfig["debug"]>; /** * If you are using the library in an environment that does not * support `window.crypto.randomUUID` you can enable a polyfill * for it. * * @public */ polyfillUUID?: boolean; /** * By default, the integration required to support the ember-inspector * browser extension is included in production builds only when using * the `ember-data` package. * * Otherwise the default is to exclude it. This setting allows to explicitly * enable/disable it in production builds. * * @public */ includeDataAdapterInProduction?: boolean; /** * The most recent version of the library from which all * deprecations have been resolved. * * For instance if all deprecations released prior to or * within `5.3` have been resolved, then setting this to * `5.3` will remove all the support for the deprecated * features for associated deprecations. * * See {@link DEPRECATIONS | deprecations} for more details. */ compatWith?: `${number}.${number}`; /** * An object of key/value pairs of logging flags * * see {@link DEPRECATIONS | deprecations} for the available flags. * * ```ts * { * DEPRECATE_THING: false, * } * ``` * * @public */ deprecations?: Partial<InternalWarpDriveConfig["deprecations"]>; /** * An object of key/value pairs of canary feature flags * for use when testing new features gated behind a flag * in a canary release version. * * see {@link FEATURES | features} for the available flags. * * ```ts * { * FEATURE_A: true, * } * ``` * * @public */ features?: Partial<InternalWarpDriveConfig["features"]>; /** * @private */ forceMode?: "testing" | "production" | "development"; }; type InternalWarpDriveConfig = { debug: typeof LOGGING; polyfillUUID: boolean; includeDataAdapter: boolean; compatWith: `${number}.${number}` | null; deprecations: ReturnType<typeof getDeprecations>; features: ReturnType<typeof getFeatures>; activeLogging: typeof LOGGING; env: { TESTING: boolean; PRODUCTION: boolean; DEBUG: boolean; }; }; export declare function setConfig(macros: object, config: WarpDriveConfig): void; export declare function setConfig(context: object, appRoot: string, config: WarpDriveConfig): void; export {};