generated from theholocron/react-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎉 update to be nextjs project
Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>
- Loading branch information
Showing
56 changed files
with
10,887 additions
and
8,849 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NEXT_PUBLIC_ENVIRONMENT="production" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NEXT_PUBLIC_ENVIRONMENT="development" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,3 +87,10 @@ coverage | |
reports | ||
dist | ||
super-linter-output | ||
.next | ||
next-env.d.ts | ||
out | ||
build | ||
.vercel | ||
.env*.local | ||
*storybook.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { type Decorator } from "@storybook/react"; | ||
import { Layout } from "../app/layout"; | ||
|
||
export function PageDecorator (Story): Decorator => { | ||
return <Layout><Story /></Layout>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import type { Metadata } from "next"; | ||
import * as React from "react"; | ||
import MSW from "../msw"; | ||
|
||
import "./app.css"; | ||
|
||
if (process.env.NEXT_RUNTIME === "nodejs") { | ||
const { server } = require('../msw/node'); | ||
server.listen(); | ||
} | ||
|
||
export const metadata: Metadata = { | ||
title: "Next.js App Router + React Server Components Demo", | ||
description: "Demo of React Server Components in Next.js.", | ||
openGraph: { | ||
title: "Next.js App Router + React Server Components Demo", | ||
description: "Demo of React Server Components in Next.js.", | ||
images: ["https://next-rsc-notes.vercel.app/og.png"], | ||
}, | ||
robots: { | ||
index: true, | ||
follow: true, | ||
}, | ||
}; | ||
|
||
export type WithChildren = Readonly<{ | ||
children: React.ReactNode; | ||
}>; | ||
|
||
export default function RootLayout (props: WithChildren) { | ||
return ( | ||
<html lang="en"> | ||
<body> | ||
<MSW.Provider>{props.children}</MSW.Provider> | ||
</body> | ||
</html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
"use client"; | ||
|
||
import * as React from "react"; | ||
import { Index } from "../pages/"; | ||
|
||
export default function IndexPage () { | ||
return <Index />; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"use client"; | ||
|
||
import { setupWorker } from "msw/browser"; | ||
import { handlers } from "./handlers"; | ||
|
||
export const worker = setupWorker(...handlers); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { handlers as authHandlers } from "../src/auth/handlers"; | ||
import { handlers as taskHandlers } from "../src/tasks/handlers"; | ||
|
||
export const handlers = [ | ||
...taskHandlers, | ||
...authHandlers, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Provider } from "./msw"; | ||
|
||
export default { Provider }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"use client"; | ||
|
||
import { Suspense, use } from "react"; | ||
|
||
const mockingEnabledPromise = | ||
typeof window !== "undefined" | ||
? import("./browser").then(async ({ worker }) => { | ||
await worker.start({ | ||
onUnhandledRequest(request, print) { | ||
if (request.url.includes("_next")) { | ||
return | ||
} | ||
print.warning() | ||
}, | ||
}) | ||
}) | ||
: Promise.resolve() | ||
|
||
|
||
export type WithChildren = Readonly<{ | ||
children: React.ReactNode; | ||
}>; | ||
|
||
function Wrapper (props: WithChildren) { | ||
use(mockingEnabledPromise); | ||
return props.children; | ||
} | ||
|
||
export function Provider (props: WithChildren) { | ||
// If MSW is enabled, we need to wait for the worker to start, | ||
// so we wrap the children in a Suspense boundary until it's ready. | ||
return ( | ||
<Suspense fallback={null}> | ||
<Wrapper>{props.children}</Wrapper> | ||
</Suspense> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { setupServer } from "msw/node"; | ||
import { handlers } from "./handlers"; | ||
|
||
export const server = setupServer(...handlers); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** @type {import('next').NextConfig} */ | ||
// const nextConfig = {}; | ||
|
||
// export default nextConfig; |
Oops, something went wrong.