FlagStream — VSCode Extension
✨ Streamline feature flag management across your JSON configuration files with real-time validation and synchronization!
✨ Features
- 🎯 Add, update, and delete feature flags across multiple configuration files
- 🔄 Real-time validation to ensure consistency across all JSON files
- 🌳 Support for nested feature flags (e.g.,
feature.subfeature.enabled )
- 🔄 Automatic synchronization across all matching JSON files
- 🎨 Type-safe feature flag values (
Boolean /String /Number )
- 🔍 Smart file watching with configurable glob patterns
- 🛡️ Built-in validation for feature flag naming conventions
📥 Installation
- Open the Extensions view in Visual Studio Code (
Cmd+Shift+X or Ctrl+Shift+X )
- Search for flag-stream and click Install
- Configure the extension settings (optional)
- Start managing your feature flags!
⚙️ Configuration
{
// Glob patterns to find feature flag files
"flagStream.include": [
"**/flags/**/*.json",
"**/feature-flags/**/*.json"
],
// Patterns to exclude
"flagStream.exclude": [
"**/node_modules/**",
"**/package*.json",
"**/test/**"
],
// Optional: Define groups of feature flag files
"flagStream.groups": [
{
"label": "Frontend Flags",
"paths": ["src/frontend/flags/**/*.json"]
},
{
"label": "Backend Flags",
"paths": ["src/backend/flags/**/*.json"]
}
]
}
🚀 Usage
✅ Adding a Feature Flag
- Open Command Palette (
Cmd+Shift+P / Ctrl+Shift+P )
- Select
FlagStream: Add Feature Flag
- Choose a group (if configured) or use all matching files
- Choose parent location or create a new root-level flag
- Enter flag name (e.g.,
feature.isEnabled or darkMode )
- Select value type (
Boolean /String /Number )
- Enter the initial value
- Confirm to apply changes across all matching files
✅ Updating Feature Flags
- Open Command Palette
- Select
FlagStream: Update Feature Flag
- Choose a group (if configured) or use all matching files
- Choose the flag to update
- Select update type (Value/Rename)
- Enter new value or name
- Review and confirm changes
✅ Deleting Feature Flags
- Open Command Palette
- Select
FlagStream: Delete Feature Flag
- Choose a group (if configured) or use all matching files
- Choose the flag to delete
- Confirm deletion
- Open Command Palette
- Select
FlagStream: Format Files
- Choose a group (if configured) or use all matching files
- Confirm to format all matching JSON files
This command will:
- Read all matching JSON files
- Apply consistent formatting
- Preserve the JSON structure
- Handle Windows and Unix paths correctly
✅ Feature Flag Groups (2.0.0 )
FlagStream supports organizing feature flags into groups for better management:
- 🏷️ Define groups in configuration with custom labels
- 📁 Specify file patterns for each group
- 🔄 Apply changes to specific groups of files
- 🎯 Target specific environments or components
- 🔍 Maintain separate flag sets for different parts of your application
🏗️ Project Structure
flag-stream/
├── src/
│ ├── extension.ts # Main extension code
│ ├── test/ # Test files
│ │ └── extension.test.ts
│ └── vscode.mock.ts # Test mocks
├── package.json # Extension manifest
└── tsconfig.json # TypeScript configuration
🧪 Testing
Run the test suite:
npm test
The test suite covers:
- Command registration and handling
- File system watching
- Configuration changes
- JSON file synchronization
📄 License
This project is licensed under the MIT License. See the LICENSE file for more details.
| |