Skip to content

Commit f0e2cd8

Browse files
committed
Migration: Use monorepo format - turborepo
1 parent e51f01b commit f0e2cd8

40 files changed

+5232
-1
lines changed

.npmrc

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

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: ["custom/next"],
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 `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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default function RootLayout({
2+
children,
3+
}: {
4+
children: React.ReactNode;
5+
}): JSX.Element {
6+
return (
7+
<html lang="en">
8+
<body>{children}</body>
9+
</html>
10+
);
11+
}

apps/docs/app/page.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Button, Header } from "ui";
2+
3+
export default function Page(): JSX.Element {
4+
return (
5+
<>
6+
<Header text="Docs" />
7+
<Button />
8+
</>
9+
);
10+
}

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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
reactStrictMode: true,
3+
transpilePackages: ["ui"],
4+
};

apps/docs/package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
},
11+
"dependencies": {
12+
"next": "^13.4.19",
13+
"react": "^18.2.0",
14+
"react-dom": "^18.2.0",
15+
"ui": "workspace:*"
16+
},
17+
"devDependencies": {
18+
"@next/eslint-plugin-next": "^13.4.19",
19+
"@types/node": "^17.0.12",
20+
"@types/react": "^18.0.22",
21+
"@types/react-dom": "^18.0.7",
22+
"eslint-config-custom": "workspace:*",
23+
"tsconfig": "workspace:*",
24+
"typescript": "^4.5.3"
25+
}
26+
}

apps/docs/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "tsconfig/nextjs.json",
3+
"compilerOptions": {
4+
"plugins": [{ "name": "next" }]
5+
},
6+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
7+
"exclude": ["node_modules"]
8+
}

apps/web/.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: ["custom/next"],
3+
};

apps/web/.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/web/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:3000](http://localhost:3000) 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:3000/api/hello](http://localhost:3000/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/web/app/layout.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default function RootLayout({
2+
children,
3+
}: {
4+
children: React.ReactNode;
5+
}): JSX.Element {
6+
return (
7+
<html lang="en">
8+
<body>{children}</body>
9+
</html>
10+
);
11+
}

apps/web/app/page.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Button, Header } from "ui";
2+
3+
export default function Page(): JSX.Element {
4+
return (
5+
<>
6+
<Header text="Web" />
7+
<Button />
8+
</>
9+
);
10+
}

apps/web/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/web/next.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
reactStrictMode: true,
3+
transpilePackages: ["ui"],
4+
};

apps/web/package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "web",
3+
"version": "1.0.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start",
9+
"lint": "next lint"
10+
},
11+
"dependencies": {
12+
"next": "^13.4.19",
13+
"react": "^18.2.0",
14+
"react-dom": "^18.2.0",
15+
"ui": "workspace:*"
16+
},
17+
"devDependencies": {
18+
"@next/eslint-plugin-next": "^13.4.19",
19+
"@types/node": "^17.0.12",
20+
"@types/react": "^18.0.22",
21+
"@types/react-dom": "^18.0.7",
22+
"eslint-config-custom": "workspace:*",
23+
"tsconfig": "workspace:*",
24+
"typescript": "^4.5.3"
25+
}
26+
}

apps/web/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "tsconfig/nextjs.json",
3+
"compilerOptions": {
4+
"plugins": [{ "name": "next" }]
5+
},
6+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
7+
"exclude": ["node_modules"]
8+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@
1313
"turbo": "latest"
1414
},
1515
"packageManager": "[email protected]",
16-
"name": "react-firebase-messenger"
16+
"name": "react-firebase-messenger",
17+
"volta": {
18+
"node": "18.17.1"
19+
}
1720
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# `@turbo/eslint-config`
2+
3+
Collection of internal eslint configurations.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const { resolve } = require("node:path");
2+
3+
const project = resolve(process.cwd(), "tsconfig.json");
4+
5+
/*
6+
* This is a custom ESLint configuration for use with
7+
* typescript packages.
8+
*
9+
* This config extends the Vercel Engineering Style Guide.
10+
* For more information, see https://github.com/vercel/style-guide
11+
*
12+
*/
13+
14+
module.exports = {
15+
extends: [
16+
"@vercel/style-guide/eslint/node",
17+
"@vercel/style-guide/eslint/typescript",
18+
].map(require.resolve),
19+
parserOptions: {
20+
project,
21+
},
22+
globals: {
23+
React: true,
24+
JSX: true,
25+
},
26+
settings: {
27+
"import/resolver": {
28+
typescript: {
29+
project,
30+
},
31+
},
32+
},
33+
ignorePatterns: ["node_modules/", "dist/"],
34+
};

packages/eslint-config-custom/next.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
const { resolve } = require("node:path");
2+
3+
const project = resolve(process.cwd(), "tsconfig.json");
4+
5+
/*
6+
* This is a custom ESLint configuration for use with
7+
* Next.js apps.
8+
*
9+
* This config extends the Vercel Engineering Style Guide.
10+
* For more information, see https://github.com/vercel/style-guide
11+
*
12+
*/
13+
14+
module.exports = {
15+
extends: [
16+
"@vercel/style-guide/eslint/node",
17+
"@vercel/style-guide/eslint/typescript",
18+
"@vercel/style-guide/eslint/browser",
19+
"@vercel/style-guide/eslint/react",
20+
"@vercel/style-guide/eslint/next",
21+
"eslint-config-turbo",
22+
].map(require.resolve),
23+
parserOptions: {
24+
project,
25+
},
26+
globals: {
27+
React: true,
28+
JSX: true,
29+
},
30+
settings: {
31+
"import/resolver": {
32+
typescript: {
33+
project,
34+
},
35+
},
36+
},
37+
ignorePatterns: ["node_modules/", "dist/"],
38+
// add rules configurations here
39+
rules: {
40+
"import/no-default-export": "off",
41+
},
42+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "eslint-config-custom",
3+
"license": "MIT",
4+
"version": "0.0.0",
5+
"private": true,
6+
"devDependencies": {
7+
"@vercel/style-guide": "^5.0.0",
8+
"eslint-config-turbo": "^1.10.12"
9+
}
10+
}

0 commit comments

Comments
 (0)