Skip to content

Commit 07e974f

Browse files
committed
chore: project setup with tailwind & shadcn
0 parents  commit 07e974f

39 files changed

+6057
-0
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
indent_size = 2
8+
indent_style = space
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true

.eslintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// This configuration only applies to the package manager root.
2+
/** @type {import("eslint").Linter.Config} */
3+
module.exports = {
4+
ignorePatterns: ["apps/**", "packages/**"],
5+
extends: ["@repo/eslint-config/library.js"],
6+
parser: "@typescript-eslint/parser",
7+
parserOptions: {
8+
project: true,
9+
},
10+
};

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
# Local env files
9+
.env
10+
.env*.local
11+
12+
# Testing
13+
coverage
14+
15+
# Turbo
16+
.turbo
17+
18+
# Vercel
19+
.vercel
20+
21+
# Build Outputs
22+
.next/
23+
out/
24+
build
25+
dist
26+
27+
28+
# Debug
29+
npm-debug.log*
30+
yarn-debug.log*
31+
yarn-error.log*
32+
33+
# Misc
34+
.DS_Store
35+
*.pem
36+
37+
# Typescript
38+
*.tsbuildinfo
39+
next-env.d.ts

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
auto-install-peers = true
2+
enable-pre-post-scripts=true # Enable pre/post scripts (for postui:add)

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 dan5py ([email protected])
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Turborepo starter with shadcn/ui
2+
3+
![Static Badge](https://img.shields.io/badge/shadcn%2Fui-2.1.2-blue?link=https%3A%2F%2Fgithub.com%2Fshadcn%2Fui)
4+
5+
This is Turborepo starter with shadcn/ui pre-configured.
6+
7+
> [!NOTE]
8+
> This example uses `pnpm` as package manager.
9+
10+
[npm version](https://github.com/dan5py/turborepo-shadcn-ui/tree/npm)
11+
[bun version](https://github.com/dan5py/turborepo-shadcn-ui/tree/bun)
12+
13+
## Using this example
14+
15+
Clone the repository:
16+
17+
```sh
18+
git clone https://github.com/dan5py/turborepo-shadcn-ui.git
19+
```
20+
21+
Install dependencies:
22+
23+
```sh
24+
cd turborepo-shadcn-ui
25+
pnpm install
26+
```
27+
28+
### Add ui components
29+
30+
Use the pre-made script:
31+
32+
```sh
33+
pnpm ui add <component-name>
34+
```
35+
36+
> This works just like the `shadcn/ui` CLI.
37+
38+
### Add a new app
39+
40+
Turborepo offer a simple command to add a new app:
41+
42+
```sh
43+
pnpm turbo gen workspace --name <app-name>
44+
```
45+
46+
This will create a new empty app in the `apps` directory.
47+
48+
If you want, you can copy an existing app with:
49+
50+
```sh
51+
pnpm turbo gen workspace --name <app-name> --copy
52+
```
53+
54+
> [!NOTE]
55+
> Remember to run `pnpm install` after copying an app.
56+
57+
## What's inside?
58+
59+
This Turborepo includes the following packages/apps:
60+
61+
### Apps and Packages
62+
63+
- `docs`: a [Next.js](https://nextjs.org/) app
64+
- `@repo/ui`: a stub React component library (🚀 powered by **shadcn/ui**)
65+
- `@repo/eslint-config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
66+
- `@repo/typescript-config`: `tsconfig.json`s used throughout the monorepo
67+
68+
Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).
69+
70+
### Utilities
71+
72+
This Turborepo has some additional tools already setup for you:
73+
74+
- [TypeScript](https://www.typescriptlang.org/) for static type checking
75+
- [ESLint](https://eslint.org/) for code linting
76+
- [Prettier](https://prettier.io) for code formatting
77+
78+
### Build
79+
80+
To build all apps and packages, run the following command:
81+
82+
```sh
83+
cd turborepo-shadcn-ui
84+
pnpm build
85+
```
86+
87+
### Develop
88+
89+
To develop all apps and packages, run the following command:
90+
91+
```sh
92+
cd turborepo-shadcn-ui
93+
pnpm dev
94+
```
95+
96+
### Remote Caching
97+
98+
Turborepo can use a technique known as [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.
99+
100+
By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup), then enter the following commands:
101+
102+
```
103+
cd turborepo-shadcn-ui
104+
npx turbo login
105+
```
106+
107+
This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview).
108+
109+
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:
110+
111+
```sh
112+
npx turbo link
113+
```
114+
115+
## Useful Links
116+
117+
Learn more about the power of Turborepo:
118+
119+
- [Tasks](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks)
120+
- [Caching](https://turbo.build/repo/docs/core-concepts/caching)
121+
- [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching)
122+
- [Filtering](https://turbo.build/repo/docs/core-concepts/monorepos/filtering)
123+
- [Configuration Options](https://turbo.build/repo/docs/reference/configuration)
124+
- [CLI Usage](https://turbo.build/repo/docs/reference/command-line-reference)
125+
126+
Learn more about shadcn/ui:
127+
128+
- [Documentation](https://ui.shadcn.com/docs)

apps/docs/.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: ["@repo/eslint-config/next.js"],
5+
parser: "@typescript-eslint/parser",
6+
parserOptions: {
7+
project: true,
8+
},
9+
};

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+
pnpm 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 `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/app/layout.tsx

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

apps/docs/app/page.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Button } from "@repo/ui/components/ui/button";
2+
3+
export default function Page() {
4+
return (
5+
<main>
6+
<Button>Click me</Button>
7+
</main>
8+
);
9+
}

0 commit comments

Comments
 (0)