Deprecate legacy feature flags, use ALWRITY_ENABLED_FEATURES only

- Remove fallback to ALWRITY_FEATURE_PROFILE, ALWRITY_ROUTER_PROFILE
- Primary env var is now ALWRITY_ENABLED_FEATURES (backend)
- Primary env var is REACT_APP_ENABLED_FEATURES (frontend)
- Add deprecation comments to all get_enabled_features() functions
- Update demoMode.ts with clear deprecation notes

Usage:
  ALWRITY_ENABLED_FEATURES=podcast      # Podcast only
  ALWRITY_ENABLED_FEATURES=all          # All features (default)
This commit is contained in:
ajaysi
2026-03-31 18:45:52 +05:30
parent cd06c6aaa8
commit edd92ec85b
4 changed files with 30 additions and 29 deletions

View File

@@ -1,22 +1,26 @@
/**
* Consolidated feature mode detection utilities.
*
* Uses ALWRITY_ENABLED_FEATURES (backend) / REACT_APP_ENABLED_FEATURES (frontend)
* Format: "all" or comma-separated features: "podcast,core"
* Primary: REACT_APP_ENABLED_FEATURES (format: "all" or "podcast,core")
*
* DEPRECATED (fallback order):
* - REACT_APP_APP_MODE
* - REACT_APP_DEMO_MODE
* - REACT_APP_PODCAST_ONLY_DEMO_MODE
*/
const ENABLED_FEATURES_STORAGE_KEYS = [
'enabled_features', // Primary
'app_mode',
'enabled_features',
'demo_mode',
'podcast_only_demo_mode',
];
const ENABLED_FEATURES_ENV_KEYS = [
'REACT_APP_ENABLED_FEATURES',
'REACT_APP_APP_MODE',
'REACT_APP_DEMO_MODE',
'REACT_APP_PODCAST_ONLY_DEMO_MODE',
'REACT_APP_ENABLED_FEATURES', // Primary - use this!
'REACT_APP_APP_MODE', // DEPRECATED
'REACT_APP_DEMO_MODE', // DEPRECATED
'REACT_APP_PODCAST_ONLY_DEMO_MODE', // DEPRECATED
];
/**