init
This commit is contained in:
3
apps/sample-website/eslint.config.mjs
Normal file
3
apps/sample-website/eslint.config.mjs
Normal file
@@ -0,0 +1,3 @@
|
||||
import { nextConfig } from "@mintel/eslint-config/next";
|
||||
|
||||
export default nextConfig;
|
||||
6
apps/sample-website/next.config.ts
Normal file
6
apps/sample-website/next.config.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import mintelNextConfig from "@mintel/next-config";
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {};
|
||||
|
||||
export default mintelNextConfig(nextConfig);
|
||||
27
apps/sample-website/package.json
Normal file
27
apps/sample-website/package.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "sample-website",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"next": "15.1.6",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"@mintel/next-utils": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.0.0",
|
||||
"@types/react": "^19.0.0",
|
||||
"@types/react-dom": "^19.0.0",
|
||||
"typescript": "^5.0.0",
|
||||
"@mintel/tsconfig": "workspace:*",
|
||||
"@mintel/eslint-config": "workspace:*",
|
||||
"@mintel/next-config": "workspace:*"
|
||||
}
|
||||
}
|
||||
14
apps/sample-website/src/app/globals.css
Normal file
14
apps/sample-website/src/app/globals.css
Normal file
@@ -0,0 +1,14 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
:root {
|
||||
--background: #ffffff;
|
||||
--foreground: #171717;
|
||||
}
|
||||
|
||||
body {
|
||||
color: var(--foreground);
|
||||
background: var(--background);
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
19
apps/sample-website/src/app/layout.tsx
Normal file
19
apps/sample-website/src/app/layout.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { Metadata } from "next";
|
||||
import "./globals.css";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Sample Website",
|
||||
description: "A sample website using @mintel shared packages",
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body>{children}</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
36
apps/sample-website/src/app/page.tsx
Normal file
36
apps/sample-website/src/app/page.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
"use client";
|
||||
|
||||
import { isValidLang, rateLimit } from "@mintel/next-utils";
|
||||
|
||||
export default function Home() {
|
||||
const testLang = "en";
|
||||
const isLangValid = isValidLang(testLang);
|
||||
|
||||
const handleTestRateLimit = async () => {
|
||||
try {
|
||||
await rateLimit("test-user");
|
||||
console.log("Rate limit check passed");
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<main className="flex min-h-screen flex-col items-center justify-between p-24">
|
||||
<div className="z-10 max-w-5xl w-full items-center justify-between font-mono text-sm lg:flex">
|
||||
<h1 className="text-4xl font-bold">Sample Website</h1>
|
||||
<p className="mt-4">
|
||||
Testing @mintel/next-utils:
|
||||
<br />
|
||||
Is {'"'}en{'"'} valid? {isLangValid ? "Yes" : "No"}
|
||||
</p>
|
||||
<button
|
||||
onClick={handleTestRateLimit}
|
||||
className="mt-4 px-4 py-2 bg-blue-500 text-white rounded"
|
||||
>
|
||||
Test Rate Limit
|
||||
</button>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
10
apps/sample-website/tsconfig.json
Normal file
10
apps/sample-website/tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "@mintel/tsconfig/nextjs.json",
|
||||
"compilerOptions": {
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
Reference in New Issue
Block a user