diff options
| author | 2023-04-28 01:47:57 +0800 | |
|---|---|---|
| committer | 2023-04-28 01:47:57 +0800 | |
| commit | 8b2c4a38a461ff5ecc95972291bc711e2c5dec9a (patch) | |
| tree | 29f552e3df949073e21bf5c76d7abc3044830ec6 /examples/with-tailwind/apps/web | |
| parent | fc8c5fdce62fb229202659408798a7b6c98f6e8b (diff) | |
| download | HydroRoll-8b2c4a38a461ff5ecc95972291bc711e2c5dec9a.tar.gz HydroRoll-8b2c4a38a461ff5ecc95972291bc711e2c5dec9a.zip | |
Diffstat (limited to 'examples/with-tailwind/apps/web')
| -rw-r--r-- | examples/with-tailwind/apps/web/.eslintrc.js | 4 | ||||
| -rw-r--r-- | examples/with-tailwind/apps/web/.gitignore | 34 | ||||
| -rw-r--r-- | examples/with-tailwind/apps/web/README.md | 30 | ||||
| -rw-r--r-- | examples/with-tailwind/apps/web/next-env.d.ts | 5 | ||||
| -rw-r--r-- | examples/with-tailwind/apps/web/next.config.js | 3 | ||||
| -rw-r--r-- | examples/with-tailwind/apps/web/package.json | 29 | ||||
| -rw-r--r-- | examples/with-tailwind/apps/web/postcss.config.js | 9 | ||||
| -rw-r--r-- | examples/with-tailwind/apps/web/src/pages/_app.tsx | 9 | ||||
| -rw-r--r-- | examples/with-tailwind/apps/web/src/pages/_document.tsx | 32 | ||||
| -rw-r--r-- | examples/with-tailwind/apps/web/src/pages/index.tsx | 48 | ||||
| -rw-r--r-- | examples/with-tailwind/apps/web/src/styles/globals.css | 3 | ||||
| -rw-r--r-- | examples/with-tailwind/apps/web/tailwind.config.js | 7 | ||||
| -rw-r--r-- | examples/with-tailwind/apps/web/tsconfig.json | 5 |
13 files changed, 218 insertions, 0 deletions
diff --git a/examples/with-tailwind/apps/web/.eslintrc.js b/examples/with-tailwind/apps/web/.eslintrc.js new file mode 100644 index 0000000..c8df607 --- /dev/null +++ b/examples/with-tailwind/apps/web/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ["custom"], +}; diff --git a/examples/with-tailwind/apps/web/.gitignore b/examples/with-tailwind/apps/web/.gitignore new file mode 100644 index 0000000..1437c53 --- /dev/null +++ b/examples/with-tailwind/apps/web/.gitignore @@ -0,0 +1,34 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env.local +.env.development.local +.env.test.local +.env.production.local + +# vercel +.vercel diff --git a/examples/with-tailwind/apps/web/README.md b/examples/with-tailwind/apps/web/README.md new file mode 100644 index 0000000..4fae62a --- /dev/null +++ b/examples/with-tailwind/apps/web/README.md @@ -0,0 +1,30 @@ +## Getting Started + +First, run the development server: + +```bash +yarn dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file. + +[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`. + +The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/examples/with-tailwind/apps/web/next-env.d.ts b/examples/with-tailwind/apps/web/next-env.d.ts new file mode 100644 index 0000000..4f11a03 --- /dev/null +++ b/examples/with-tailwind/apps/web/next-env.d.ts @@ -0,0 +1,5 @@ +/// <reference types="next" /> +/// <reference types="next/image-types/global" /> + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/examples/with-tailwind/apps/web/next.config.js b/examples/with-tailwind/apps/web/next.config.js new file mode 100644 index 0000000..da1bb77 --- /dev/null +++ b/examples/with-tailwind/apps/web/next.config.js @@ -0,0 +1,3 @@ +module.exports = { + reactStrictMode: true, +}; diff --git a/examples/with-tailwind/apps/web/package.json b/examples/with-tailwind/apps/web/package.json new file mode 100644 index 0000000..17834e5 --- /dev/null +++ b/examples/with-tailwind/apps/web/package.json @@ -0,0 +1,29 @@ +{ + "name": "web", + "version": "1.0.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "next": "latest", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "ui": "workspace:*" + }, + "devDependencies": { + "@types/node": "^18.11.17", + "@types/react": "^18.0.26", + "@types/react-dom": "^18.0.9", + "autoprefixer": "^10.4.13", + "eslint-config-custom": "workspace:*", + "postcss": "^8.4.20", + "tailwind-config": "workspace:*", + "tailwindcss": "^3.2.4", + "tsconfig": "workspace:*", + "typescript": "^4.9.4" + } +} diff --git a/examples/with-tailwind/apps/web/postcss.config.js b/examples/with-tailwind/apps/web/postcss.config.js new file mode 100644 index 0000000..07aa434 --- /dev/null +++ b/examples/with-tailwind/apps/web/postcss.config.js @@ -0,0 +1,9 @@ +// If you want to use other PostCSS plugins, see the following: +// https://tailwindcss.com/docs/using-with-preprocessors + +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +}; diff --git a/examples/with-tailwind/apps/web/src/pages/_app.tsx b/examples/with-tailwind/apps/web/src/pages/_app.tsx new file mode 100644 index 0000000..cab70f5 --- /dev/null +++ b/examples/with-tailwind/apps/web/src/pages/_app.tsx @@ -0,0 +1,9 @@ +import "../styles/globals.css"; +// include styles from the ui package +import "ui/styles.css"; + +import type { AppProps } from "next/app"; + +export default function MyApp({ Component, pageProps }: AppProps) { + return <Component {...pageProps} />; +} diff --git a/examples/with-tailwind/apps/web/src/pages/_document.tsx b/examples/with-tailwind/apps/web/src/pages/_document.tsx new file mode 100644 index 0000000..a091efe --- /dev/null +++ b/examples/with-tailwind/apps/web/src/pages/_document.tsx @@ -0,0 +1,32 @@ +import Document, { + DocumentContext, + DocumentInitialProps, + Html, + Head, + Main, + NextScript, +} from "next/document"; + +class MyDocument extends Document { + static async getInitialProps( + ctx: DocumentContext + ): Promise<DocumentInitialProps> { + const initialProps = await Document.getInitialProps(ctx); + + return initialProps; + } + + render() { + return ( + <Html className="bg-zinc-900"> + <Head /> + <body> + <Main /> + <NextScript /> + </body> + </Html> + ); + } +} + +export default MyDocument; diff --git a/examples/with-tailwind/apps/web/src/pages/index.tsx b/examples/with-tailwind/apps/web/src/pages/index.tsx new file mode 100644 index 0000000..27f57cb --- /dev/null +++ b/examples/with-tailwind/apps/web/src/pages/index.tsx @@ -0,0 +1,48 @@ +import Head from "next/head"; +import { Button, Card } from "ui"; + +const CARD_CONTENT = [ + { + title: "Caching Tasks", + href: "https://turbo.build/repo/docs/core-concepts/caching", + cta: "Read More", + }, + { + title: "Running Tasks", + href: "https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks", + cta: "Read More", + }, + { + title: "Configuration Options", + href: "https://turbo.build/repo/docs/reference/configuration", + cta: "Read More", + }, +]; + +export default function Home() { + return ( + <div className="flex min-h-screen flex-col items-center justify-center py-2"> + <Head> + <title>Web - Turborepo Example</title> + </Head> + + <main className="mx-auto w-auto px-4 pt-16 pb-8 sm:pt-24 lg:px-8"> + <h1 className="mx-auto text-center text-6xl font-extrabold tracking-tight text-white sm:text-7xl lg:text-8xl xl:text-8xl"> + Web + <span className="block bg-gradient-to-r from-brandred to-brandblue bg-clip-text text-transparent px-2"> + Turborepo Example + </span> + </h1> + <div className="mx-auto mt-5 max-w-xl sm:flex sm:justify-center md:mt-8"> + <Button /> + </div> + + <div className="mt-12 grid grid-cols-1 sm:grid-cols-3 gap-4 place-content-evenly"> + {CARD_CONTENT.map((card) => ( + <Card key={card.title} {...card} /> + ))} + </div> + </main> + </div> + ); +} diff --git a/examples/with-tailwind/apps/web/src/styles/globals.css b/examples/with-tailwind/apps/web/src/styles/globals.css new file mode 100644 index 0000000..b5c61c9 --- /dev/null +++ b/examples/with-tailwind/apps/web/src/styles/globals.css @@ -0,0 +1,3 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/examples/with-tailwind/apps/web/tailwind.config.js b/examples/with-tailwind/apps/web/tailwind.config.js new file mode 100644 index 0000000..cc78ae3 --- /dev/null +++ b/examples/with-tailwind/apps/web/tailwind.config.js @@ -0,0 +1,7 @@ +// tailwind config is required for editor support + +const sharedConfig = require("tailwind-config/tailwind.config.js"); + +module.exports = { + presets: [sharedConfig], +}; diff --git a/examples/with-tailwind/apps/web/tsconfig.json b/examples/with-tailwind/apps/web/tsconfig.json new file mode 100644 index 0000000..a355365 --- /dev/null +++ b/examples/with-tailwind/apps/web/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "tsconfig/nextjs.json", + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] +} |
