Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update basic example for App Router. #4839

Merged
merged 5 commits into from May 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions examples/basic/apps/docs/app/layout.tsx
@@ -0,0 +1,11 @@
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
10 changes: 10 additions & 0 deletions examples/basic/apps/docs/app/page.tsx
@@ -0,0 +1,10 @@
import { Button, Header } from "ui";

export default function Page() {
return (
<>
<Header text="Docs" />
<Button />
</>
);
}
2 changes: 1 addition & 1 deletion examples/basic/apps/docs/package.json
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"next": "latest",
"next": "^13.4.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"ui": "workspace:*"
Expand Down
10 changes: 0 additions & 10 deletions examples/basic/apps/docs/pages/index.tsx

This file was deleted.

5 changes: 4 additions & 1 deletion examples/basic/apps/docs/tsconfig.json
@@ -1,5 +1,8 @@
{
"extends": "tsconfig/nextjs.json",
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"compilerOptions": {
"plugins": [{ "name": "next" }]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
11 changes: 11 additions & 0 deletions examples/basic/apps/web/app/layout.tsx
@@ -0,0 +1,11 @@
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
10 changes: 10 additions & 0 deletions examples/basic/apps/web/app/page.tsx
@@ -0,0 +1,10 @@
import { Button, Header } from "ui";

export default function Page() {
return (
<>
<Header text="Web" />
<Button />
</>
);
}
2 changes: 1 addition & 1 deletion examples/basic/apps/web/package.json
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"next": "latest",
"next": "^13.4.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"ui": "workspace:*"
Expand Down
10 changes: 0 additions & 10 deletions examples/basic/apps/web/pages/index.tsx

This file was deleted.

5 changes: 4 additions & 1 deletion examples/basic/apps/web/tsconfig.json
@@ -1,5 +1,8 @@
{
"extends": "tsconfig/nextjs.json",
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"compilerOptions": {
"plugins": [{ "name": "next" }]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion examples/basic/package.json
Expand Up @@ -10,7 +10,7 @@
"eslint": "^7.32.0",
"eslint-config-custom": "workspace:*",
"prettier": "^2.5.1",
"turbo": "latest"
"turbo": "^1.9.3"
},
"packageManager": "pnpm@7.15.0"
}
4 changes: 2 additions & 2 deletions examples/basic/packages/eslint-config-custom/package.json
Expand Up @@ -4,10 +4,10 @@
"main": "index.js",
"license": "MIT",
"dependencies": {
"eslint-config-next": "latest",
"eslint-config-next": "^13.4.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-react": "7.28.0",
"eslint-config-turbo": "latest"
"eslint-config-turbo": "^1.9.3"
},
"publishConfig": {
"access": "public"
Expand Down
1 change: 1 addition & 0 deletions examples/basic/packages/tsconfig/nextjs.json
Expand Up @@ -3,6 +3,7 @@
"display": "Next.js",
"extends": "./base.json",
"compilerOptions": {
"plugins": [{ "name": "next" }],
"allowJs": true,
"declaration": false,
"declarationMap": false,
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/packages/tsconfig/react-library.json
Expand Up @@ -4,7 +4,7 @@
"extends": "./base.json",
"compilerOptions": {
"jsx": "react-jsx",
"lib": ["ES2015"],
"lib": ["ES2015", "DOM"],
"module": "ESNext",
"target": "es6"
}
Expand Down
4 changes: 3 additions & 1 deletion examples/basic/packages/ui/Button.tsx
@@ -1,5 +1,7 @@
"use client";

import * as React from "react";

export const Button = () => {
return <button>Boop</button>;
return <button onClick={() => alert("boop")}>Boop</button>;
};
5 changes: 5 additions & 0 deletions examples/basic/packages/ui/Header.tsx
@@ -0,0 +1,5 @@
import * as React from "react";

export const Header = ({ text }: { text: string }) => {
return <h1>{text}</h1>;
};
1 change: 1 addition & 0 deletions examples/basic/packages/ui/index.tsx
@@ -1,2 +1,3 @@
import * as React from "react";
export * from "./Button";
export * from "./Header";