Skip to content

Commit eecb3fb

Browse files
refactor: remove unused animationFeatureFlag and reorganize flag imports
1 parent 974c458 commit eecb3fb

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed
Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +0,0 @@
1-
import { verifyAccess, type ApiData } from "flags";
2-
import { createFlagsDiscoveryEndpoint, getProviderData } from "flags/next";
3-
import { type NextRequest } from "next/server";
4-
import * as flags from "../../../../flags";
5-
6-
export const GET = createFlagsDiscoveryEndpoint(
7-
async (request: NextRequest) => {
8-
const access = await verifyAccess(request.headers.get("Authorization"));
9-
if (!access) {
10-
return null;
11-
}
12-
const providerData: ApiData = getProviderData(flags);
13-
// return the ApiData directly, without a NextResponse.json object.
14-
return providerData;
15-
}
16-
);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { verifyAccess, type ApiData } from "flags";
2+
import { createFlagsDiscoveryEndpoint, getProviderData } from "flags/next";
3+
import { type NextRequest } from "next/server";
4+
import * as flags from "../../../flags";
5+
6+
export const GET = createFlagsDiscoveryEndpoint(
7+
async (request: NextRequest) => {
8+
const access = await verifyAccess(request.headers.get("Authorization"));
9+
if (!access) {
10+
return null;
11+
}
12+
const providerData: ApiData = getProviderData(flags);
13+
// return the ApiData directly, without a NextResponse.json object.
14+
return providerData;
15+
}
16+
);

src/app/animation/flags.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/app/animation/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { animationFeatureFlag } from "./flags";
1+
import { animationFeatureFlag } from "../flags";
22
import AnimatedBox from "../components/AnimatedBox";
33

44
export default async function AnimationPage() {

src/app/flags.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ export const weatherWidgetFlag = flag({
55
description: "Enable the weather widget for users.",
66
decide: () => process.env.NEW_WEATHER_FLAG === "true",
77
});
8+
9+
export const animationFeatureFlag = flag<boolean>({
10+
key: "animation-feature",
11+
description: "Enable animations in the app.",
12+
decide: () => process.env.ANIMATION_FEATURE_ENABLED === "true",
13+
});

src/app/task-list.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use client";
12
import { useState } from "react";
23

34
export default function TaskList() {

0 commit comments

Comments
 (0)