mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Signed-off-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
// Single source of truth for E2E tests: derive preview-feature data from
|
|
// /preview-features.json so we don't have to hand-maintain a parallel array.
|
|
//
|
|
// Production reads the same JSON via the `@features-manifest` vite alias
|
|
// (see `desktop/src/shared/features/manifest.ts`). The localStorage key
|
|
// format matches `OVERRIDES_KEY` in `desktop/src/shared/features/store.ts`
|
|
// — bumping `version` in `preview-features.json` updates production AND
|
|
// every spec automatically.
|
|
import featuresManifest from "../../../preview-features.json" with {
|
|
type: "json",
|
|
};
|
|
|
|
interface FeatureDefinition {
|
|
id: string;
|
|
name: string;
|
|
description: string;
|
|
platforms?: string[];
|
|
}
|
|
|
|
interface FeaturesManifest {
|
|
version: number;
|
|
features: FeatureDefinition[];
|
|
}
|
|
|
|
const manifest = featuresManifest as FeaturesManifest;
|
|
|
|
/** IDs of every preview feature on desktop. */
|
|
export const PREVIEW_FEATURE_IDS: string[] = manifest.features
|
|
.filter((f) => !f.platforms || f.platforms.includes("desktop"))
|
|
.map((f) => f.id);
|
|
|
|
/**
|
|
* The localStorage key the production store uses for feature overrides.
|
|
* Mirrors `OVERRIDES_KEY` in `src/shared/features/store.ts` so a manifest
|
|
* version bump flows through to E2E seeding without manual updates.
|
|
*/
|
|
export const FEATURE_OVERRIDES_STORAGE_KEY = `buzz-feature-overrides-v${manifest.version}`;
|