Skip to content

Commit cc35998

Browse files
committed
chore: 🤖 init using with-tailwind template
https://github.com/vercel/turbo/tree/main/examples/with-tailwind
1 parent 5c2da44 commit cc35998

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+5909
-0
lines changed

‎.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
node_modules
5+
.pnp
6+
.pnp.js
7+
8+
# testing
9+
coverage
10+
11+
# next.js
12+
.next/
13+
out/
14+
build
15+
.swc/
16+
17+
# misc
18+
.DS_Store
19+
*.pem
20+
21+
# debug
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*
25+
26+
# local env files
27+
.env.local
28+
.env.development.local
29+
.env.test.local
30+
.env.production.local
31+
32+
# turbo
33+
.turbo
34+
35+
# ui
36+
dist/

‎.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
auto-install-peers = true

‎.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"eslint.workingDirectories": [
3+
{
4+
"mode": "auto"
5+
}
6+
]
7+
}

‎README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Turborepo Tailwind CSS starter
2+
3+
This is an official starter Turborepo.
4+
5+
## Using this example
6+
7+
Run the following command:
8+
9+
```sh
10+
npx create-turbo@latest -e with-tailwind
11+
```
12+
13+
## What's inside?
14+
15+
This Turborepo includes the following packages/apps:
16+
17+
### Apps and Packages
18+
19+
- `docs`: a [Next.js](https://nextjs.org/) app with [Tailwind CSS](https://tailwindcss.com/)
20+
- `web`: another [Next.js](https://nextjs.org/) app with [Tailwind CSS](https://tailwindcss.com/)
21+
- `ui`: a stub React component library with [Tailwind CSS](https://tailwindcss.com/) shared by both `web` and `docs` applications
22+
- `@repo/eslint-config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
23+
- `@repo/typescript-config`: `tsconfig.json`s used throughout the monorepo
24+
25+
Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).
26+
27+
### Building packages/ui
28+
29+
This example is set up to produce compiled styles for `ui` components into the `dist` directory. The component `.tsx` files are consumed by the Next.js apps directly using `transpilePackages` in `next.config.js`. This was chosen for several reasons:
30+
31+
- Make sharing one `tailwind.config.js` to apps and packages as easy as possible.
32+
- Make package compilation simple by only depending on the Next.js Compiler and `tailwindcss`.
33+
- Ensure Tailwind classes do not overwrite each other. The `ui` package uses a `ui-` prefix for it's classes.
34+
- Maintain clear package export boundaries.
35+
36+
Another option is to consume `packages/ui` directly from source without building. If using this option, you will need to update the `tailwind.config.js` in your apps to be aware of your package locations, so it can find all usages of the `tailwindcss` class names for CSS compilation.
37+
38+
For example, in [tailwind.config.js](packages/tailwind-config/tailwind.config.js):
39+
40+
```js
41+
content: [
42+
// app content
43+
`src/**/*.{js,ts,jsx,tsx}`,
44+
// include packages if not transpiling
45+
"../../packages/ui/*.{js,ts,jsx,tsx}",
46+
],
47+
```
48+
49+
If you choose this strategy, you can remove the `tailwindcss` and `autoprefixer` dependencies from the `ui` package.
50+
51+
### Utilities
52+
53+
This Turborepo has some additional tools already setup for you:
54+
55+
- [Tailwind CSS](https://tailwindcss.com/) for styles
56+
- [TypeScript](https://www.typescriptlang.org/) for static type checking
57+
- [ESLint](https://eslint.org/) for code linting
58+
- [Prettier](https://prettier.io) for code formatting

‎apps/docs/.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ["@repo/eslint-config/next.js"],
3+
};

‎apps/docs/.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
32+
33+
# vercel
34+
.vercel

‎apps/docs/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## Getting Started
2+
3+
First, run the development server:
4+
5+
```bash
6+
yarn dev
7+
```
8+
9+
Open [http://localhost:3001](http://localhost:3001) with your browser to see the result.
10+
11+
You can start editing the page by modifying `src/app/page.tsx`. The page auto-updates as you edit the file.
12+
13+
To create [API routes](https://nextjs.org/docs/app/building-your-application/routing/router-handlers) add an `api/` directory to the `app/` directory with a `route.ts` file. For individual endpoints, create a subfolder in the `api` directory, like `api/hello/route.ts` would map to [http://localhost:3001/api/hello](http://localhost:3001/api/hello).
14+
15+
## Learn More
16+
17+
To learn more about Next.js, take a look at the following resources:
18+
19+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
20+
- [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial.
21+
22+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
23+
24+
## Deploy on Vercel
25+
26+
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.
27+
28+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

‎apps/docs/next-env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

‎apps/docs/next.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import('next').NextConfig} */
2+
module.exports = {
3+
reactStrictMode: true,
4+
transpilePackages: ["@repo/ui"],
5+
};

‎apps/docs/package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "docs",
3+
"version": "1.0.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev --port 3001",
7+
"build": "next build",
8+
"start": "next start",
9+
"lint": "next lint",
10+
"type-check": "tsc --noEmit"
11+
},
12+
"dependencies": {
13+
"@repo/ui": "workspace:*",
14+
"next": "^14.2.3",
15+
"react": "^18.2.0",
16+
"react-dom": "^18.2.0"
17+
},
18+
"devDependencies": {
19+
"@next/eslint-plugin-next": "^14.2.3",
20+
"@repo/eslint-config": "workspace:*",
21+
"@repo/tailwind-config": "workspace:*",
22+
"@repo/typescript-config": "workspace:*",
23+
"@types/node": "^20.11.24",
24+
"@types/react": "^18.2.61",
25+
"@types/react-dom": "^18.2.19",
26+
"autoprefixer": "^10.4.18",
27+
"postcss": "^8.4.35",
28+
"tailwindcss": "^3.4.1",
29+
"typescript": "^5.3.3"
30+
}
31+
}

‎apps/docs/postcss.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// If you want to use other PostCSS plugins, see the following:
2+
// https://tailwindcss.com/docs/using-with-preprocessors
3+
4+
module.exports = {
5+
plugins: {
6+
tailwindcss: {},
7+
autoprefixer: {},
8+
},
9+
};

‎apps/docs/public/circles.svg

Lines changed: 17 additions & 0 deletions
Loading

‎apps/docs/public/next.svg

Lines changed: 1 addition & 0 deletions
Loading

‎apps/docs/public/turborepo.svg

Lines changed: 32 additions & 0 deletions
Loading

‎apps/docs/public/vercel.svg

Lines changed: 1 addition & 0 deletions
Loading

‎apps/docs/src/app/favicon.ico

8.07 KB
Binary file not shown.

‎apps/docs/src/app/globals.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
:root {
6+
--foreground-rgb: 0, 0, 0;
7+
--background-start-rgb: 214, 219, 220;
8+
--background-end-rgb: 255, 255, 255;
9+
}
10+
11+
@media (prefers-color-scheme: dark) {
12+
:root {
13+
--foreground-rgb: 255, 255, 255;
14+
--background-start-rgb: 0, 0, 0;
15+
--background-end-rgb: 0, 0, 0;
16+
}
17+
}
18+
19+
body {
20+
color: rgb(var(--foreground-rgb));
21+
background: linear-gradient(
22+
to bottom,
23+
transparent,
24+
rgb(var(--background-end-rgb))
25+
)
26+
rgb(var(--background-start-rgb));
27+
}

‎apps/docs/src/app/layout.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import "./globals.css";
2+
import "@repo/ui/styles.css";
3+
import type { Metadata } from "next";
4+
import { Inter } from "next/font/google";
5+
6+
const inter = Inter({ subsets: ["latin"] });
7+
8+
export const metadata: Metadata = {
9+
title: "Create Turborepo",
10+
description: "Generated by create turbo",
11+
};
12+
13+
export default function RootLayout({
14+
children,
15+
}: {
16+
children: React.ReactNode;
17+
}): JSX.Element {
18+
return (
19+
<html lang="en">
20+
<body className={inter.className}>{children}</body>
21+
</html>
22+
);
23+
}

0 commit comments

Comments
 (0)