Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Lightweight, environment-based feature flag system for Nuxt 3 — made for devel
- 🔐 Limit access to specific APIs by feature flag in server handlers
- 🎯 Roll out features to internal QA teams without branching or releases
- 📆 Schedule feature launches for specific environments or timeframes

🕵️‍♀️ Detect undeclared feature flags at build time with configurable validation and precise file context
-
## Planned Features

- 🧩 Nuxt DevTools integration with a Feature Flag Explorer and Environment Switcher
Expand All @@ -23,8 +24,6 @@ Lightweight, environment-based feature flag system for Nuxt 3 — made for devel
- 🧍‍♂️ Show features only for specific users (e.g., staff-only UIs, admin panels etc.)
- 🧬 Environment inheritance which lets environments inherit feature flags from others
- 💡 Flag descriptions / metadata for better documentation, DevTools tooltips, or internal usage notes
- 🕵️ Unused flag detection to warn about declared flags that are never used in your app
- 🚨 Strict mode to throw errors or warnings if a used feature flag is not declared in the config
- 🛠 Programmatic overrides to toggle or override feature flags dynamically at runtime (e.g., per user or session)

## Quick Setup
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"@types/node": "latest",
"changelogen": "^0.6.1",
"eslint": "^9.26.0",
"globby": "^14.1.0",
"nuxt": "^3.17.3",
"typescript": "~5.8.3",
"vitest": "^3.1.3",
Expand Down
6 changes: 6 additions & 0 deletions playground/middleware/feature-not-existing-flag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default defineNuxtRouteMiddleware(() => {
const { isEnabled } = useFeatureFlag()
if (!isEnabled('notExistingFlagMiddleware')) {
return showError({ statusCode: 404, statusMessage: 'Not available' })
}
})
5 changes: 5 additions & 0 deletions playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,10 @@ export default defineNuxtConfig({
staging: ['newSystem'],
production: [],
},
validation: {
mode: 'warn',
includeGlobs: ['**/*.{vue,ts,js}'],
excludeGlobs: ['node_modules', '.nuxt', 'dist'],
},
},
})
13 changes: 13 additions & 0 deletions playground/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@
</div>
</div>

<!-- Non-existing feature flag use to trigger strict mode -->
<div class="hidden">
<p v-feature="'nonExistingFlagDirective'">
This paragraph is only visible if the non-existing flag is enabled. It is using the v-feature directive to conditionally render content based on the feature flag status.
</p>
</div>

<div class="hidden">
<p v-if="isEnabled('nonExistingFlagVif')">
This paragraph is only visible if the non-existing flag is enabled. It is using the v-if directive to conditionally render content based on the feature flag status.
</p>
</div>

<!-- Modal -->
<div
v-if="showBetaModal"
Expand Down
Loading