Skip to content

Commit 84e38d4

Browse files
authored
adds an playground app we can use during development (#341)
* add flags-playground * clarify * move * update lockfile
1 parent a3b536b commit 84e38d4

20 files changed

+2101
-68
lines changed

apps/playground/.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
/out/
19+
20+
# production
21+
/build
22+
23+
# misc
24+
.DS_Store
25+
*.pem
26+
27+
# debug
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
.pnpm-debug.log*
32+
33+
# env files (can opt-in for committing if needed)
34+
.env*
35+
36+
# vercel
37+
.vercel
38+
39+
# typescript
40+
*.tsbuildinfo
41+
next-env.d.ts
42+
.env*.local

apps/playground/AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!-- BEGIN:nextjs-agent-rules -->
2+
# This is NOT the Next.js you know
3+
4+
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices.
5+
<!-- END:nextjs-agent-rules -->

apps/playground/CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@AGENTS.md

apps/playground/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# flags-playground
2+
3+
Internal development app used to manually test changes to `flags` package and its adapters. This is **not** meant to be a public example or starter template.
4+
5+
## Getting Started
6+
7+
```bash
8+
pnpm dev
9+
```
10+
11+
Open [http://localhost:3000](http://localhost:3000) to verify your changes.

apps/playground/app/favicon.ico

25.3 KB
Binary file not shown.

apps/playground/app/globals.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@import "tailwindcss";
2+
3+
:root {
4+
--background: #ffffff;
5+
--foreground: #171717;
6+
}
7+
8+
@theme inline {
9+
--color-background: var(--background);
10+
--color-foreground: var(--foreground);
11+
--font-sans: var(--font-geist-sans);
12+
--font-mono: var(--font-geist-mono);
13+
}
14+
15+
@media (prefers-color-scheme: dark) {
16+
:root {
17+
--background: #0a0a0a;
18+
--foreground: #ededed;
19+
}
20+
}
21+
22+
body {
23+
background: var(--background);
24+
color: var(--foreground);
25+
font-family: Arial, Helvetica, sans-serif;
26+
}

apps/playground/app/layout.tsx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import type { Metadata } from 'next';
2+
import { Geist, Geist_Mono } from 'next/font/google';
3+
import './globals.css';
4+
5+
const geistSans = Geist({
6+
variable: '--font-geist-sans',
7+
subsets: ['latin'],
8+
});
9+
10+
const geistMono = Geist_Mono({
11+
variable: '--font-geist-mono',
12+
subsets: ['latin'],
13+
});
14+
15+
export const metadata: Metadata = {
16+
title: 'Create Next App',
17+
description: 'Generated by create next app',
18+
};
19+
20+
export default function RootLayout({
21+
children,
22+
}: Readonly<{
23+
children: React.ReactNode;
24+
}>) {
25+
return (
26+
<html
27+
lang="en"
28+
className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
29+
>
30+
<body className="min-h-full flex flex-col">{children}</body>
31+
</html>
32+
);
33+
}

apps/playground/app/page.tsx

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import Image from 'next/image';
2+
import { jsonFlag } from '../flags';
3+
4+
export default async function Home() {
5+
const data = await jsonFlag();
6+
7+
return (
8+
<div className="flex flex-col flex-1 items-center justify-center bg-zinc-50 font-sans dark:bg-black">
9+
<main className="flex flex-1 w-full max-w-3xl flex-col items-center justify-between py-32 px-16 bg-white dark:bg-black sm:items-start">
10+
<Image
11+
className="dark:invert"
12+
src="/next.svg"
13+
alt="Next.js logo"
14+
width={100}
15+
height={20}
16+
priority
17+
/>
18+
<div className="flex flex-col items-center gap-6 text-center sm:items-start sm:text-left">
19+
<pre>{JSON.stringify(data, null, 2)}</pre>
20+
<h1 className="max-w-xs text-3xl font-semibold leading-10 tracking-tight text-black dark:text-zinc-50">
21+
To get started, edit the page.tsx file.
22+
</h1>
23+
<p className="max-w-md text-lg leading-8 text-zinc-600 dark:text-zinc-400">
24+
Looking for a starting point or more instructions? Head over to{' '}
25+
<a
26+
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
27+
className="font-medium text-zinc-950 dark:text-zinc-50"
28+
>
29+
Templates
30+
</a>{' '}
31+
or the{' '}
32+
<a
33+
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
34+
className="font-medium text-zinc-950 dark:text-zinc-50"
35+
>
36+
Learning
37+
</a>{' '}
38+
center.
39+
</p>
40+
</div>
41+
<div className="flex flex-col gap-4 text-base font-medium sm:flex-row">
42+
<a
43+
className="flex h-12 w-full items-center justify-center gap-2 rounded-full bg-foreground px-5 text-background transition-colors hover:bg-[#383838] dark:hover:bg-[#ccc] md:w-[158px]"
44+
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
45+
target="_blank"
46+
rel="noopener noreferrer"
47+
>
48+
<Image
49+
className="dark:invert"
50+
src="/vercel.svg"
51+
alt="Vercel logomark"
52+
width={16}
53+
height={16}
54+
/>
55+
Deploy Now
56+
</a>
57+
<a
58+
className="flex h-12 w-full items-center justify-center rounded-full border border-solid border-black/[.08] px-5 transition-colors hover:border-transparent hover:bg-black/[.04] dark:border-white/[.145] dark:hover:bg-[#1a1a1a] md:w-[158px]"
59+
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
60+
target="_blank"
61+
rel="noopener noreferrer"
62+
>
63+
Documentation
64+
</a>
65+
</div>
66+
</main>
67+
</div>
68+
);
69+
}

apps/playground/eslint.config.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { defineConfig, globalIgnores } from 'eslint/config';
2+
import nextVitals from 'eslint-config-next/core-web-vitals';
3+
import nextTs from 'eslint-config-next/typescript';
4+
5+
const eslintConfig = defineConfig([
6+
...nextVitals,
7+
...nextTs,
8+
// Override default ignores of eslint-config-next.
9+
globalIgnores([
10+
// Default ignores of eslint-config-next:
11+
'.next/**',
12+
'out/**',
13+
'build/**',
14+
'next-env.d.ts',
15+
]),
16+
]);
17+
18+
export default eslintConfig;

apps/playground/flags.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { vercelAdapter } from '@flags-sdk/vercel';
2+
import { flag } from 'flags/next';
3+
4+
export const jsonFlag = flag({
5+
key: 'json-flag',
6+
adapter: vercelAdapter(),
7+
});

0 commit comments

Comments
 (0)