diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 94469e4..d33707d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,6 +37,9 @@ jobs: build: runs-on: ubuntu-latest needs: lint + environment: Preview + env: + NEXT_PUBLIC_FLAGSMITH_ENVIRONMENT_ID: ${{ secrets.NEXT_PUBLIC_FLAGSMITH_ENVIRONMENT_ID }} steps: - name: Check out Git repository diff --git a/README.md b/README.md index dfe58ef..1a40067 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ Ultra-Reporter leverages cutting-edge technologies to provide fast, efficient, a - **[Turborepo](https://turborepo.org/)**: Fast, efficient monorepo management. - **[ESLint](https://eslint.org/) & [Prettier](https://prettier.io/)**: Enforce consistent code style and automate code formatting. - **[Prettier](https://prettier.io/)**: Code formatter. +- **[Flagsmith](https://www.flagsmith.com/)**: Feature flag management. - **[Vercel](https://vercel.com/)**: Next.js is deployed on Vercel, a platform for static websites and serverless functions. ## ⏱️ What's Next? diff --git a/apps/web/.env.example b/apps/web/.env.example new file mode 100644 index 0000000..4c9a877 --- /dev/null +++ b/apps/web/.env.example @@ -0,0 +1 @@ +NEXT_PUBLIC_FLAGSMITH_ENVIRONMENT_ID= \ No newline at end of file diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx index 5ce8503..62a282a 100644 --- a/apps/web/app/layout.tsx +++ b/apps/web/app/layout.tsx @@ -1,5 +1,7 @@ import { GoogleAnalytics } from '@next/third-parties/google'; import { Provider as AnalyticsProvider } from '@ultra-reporter/analytics/client'; +import { getFeatureState } from '@ultra-reporter/feature-toggle/client'; +import { FeatureProvider } from '@ultra-reporter/feature-toggle/provider'; import '@ultra-reporter/ui/global.css'; import { Footer } from '@ultra-reporter/ui/home/footer'; import { ScrollToTop } from '@ultra-reporter/ui/home/scroll-to-top'; @@ -63,33 +65,37 @@ export const metadata: Metadata = { }, }; -const RootLayout = ({ +const RootLayout = async ({ children, }: Readonly<{ children: React.ReactNode; -}>): DetailedHTMLProps< - HtmlHTMLAttributes, - HTMLHtmlElement +}>): Promise< + DetailedHTMLProps, HTMLHtmlElement> > => { + const featureState = await getFeatureState(); return ( - - - {children} - -