Skip to content

Commit 28fadaf

Browse files
committed
Add structure
1 parent 892b478 commit 28fadaf

Some content is hidden

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

63 files changed

+1890
-20
lines changed

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,40 @@ out/
8181
gradle-app.setting
8282
!gradle-wrapper.jar
8383
.gradletasknamecache
84+
85+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
86+
87+
# dependencies
88+
node_modules
89+
.pnp
90+
.pnp.js
91+
92+
# testing
93+
coverage
94+
95+
# next.js
96+
.next/
97+
build
98+
99+
# misc
100+
*.pem
101+
102+
# debug
103+
npm-debug.log*
104+
yarn-debug.log*
105+
yarn-error.log*
106+
107+
# local env files
108+
.env
109+
.env.local
110+
.env.development.local
111+
.env.test.local
112+
.env.production.local
113+
114+
# turbo
115+
.turbo
116+
117+
# vercel
118+
.vercel
119+
120+
yarn.lock

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Turborepo 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
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
20+
- `web`: another [Next.js](https://nextjs.org/) app
21+
- `ui`: a stub React component library shared by both `web` and `docs` applications
22+
- `eslint-config-custom`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
23+
- `tsconfig`: `tsconfig.json`s used throughout the monorepo
24+
25+
Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).
26+
27+
### Utilities
28+
29+
This Turborepo has some additional tools already setup for you:
30+
31+
- [TypeScript](https://www.typescriptlang.org/) for static type checking
32+
- [ESLint](https://eslint.org/) for code linting
33+
- [Prettier](https://prettier.io) for code formatting
34+
35+
### Build
36+
37+
To build all apps and packages, run the following command:
38+
39+
```
40+
cd my-turborepo
41+
pnpm build
42+
```
43+
44+
### Develop
45+
46+
To develop all apps and packages, run the following command:
47+
48+
```
49+
cd my-turborepo
50+
pnpm dev
51+
```
52+
53+
### Remote Caching
54+
55+
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.
56+
57+
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:
58+
59+
```
60+
cd my-turborepo
61+
npx turbo login
62+
```
63+
64+
This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview).
65+
66+
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:
67+
68+
```
69+
npx turbo link
70+
```
71+
72+
## Useful Links
73+
74+
Learn more about the power of Turborepo:
75+
76+
- [Tasks](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks)
77+
- [Caching](https://turbo.build/repo/docs/core-concepts/caching)
78+
- [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching)
79+
- [Filtering](https://turbo.build/repo/docs/core-concepts/monorepos/filtering)
80+
- [Configuration Options](https://turbo.build/repo/docs/reference/configuration)
81+
- [CLI Usage](https://turbo.build/repo/docs/reference/command-line-reference)

build.gradle.kts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ plugins {
88
}
99

1010
val projectVersion = file("version").readLines().first()
11-
project.extra["apiVersion"] = projectVersion.replace("\\.[1-9]\\d*-SNAPSHOT|\\.0|\\.\\d*\$".toRegex(), "")
1211

1312
allprojects {
1413
apply(plugin = "org.jetbrains.kotlin.jvm")
@@ -23,12 +22,12 @@ allprojects {
2322

2423
tasks {
2524
withType<KotlinCompile> {
26-
kotlinOptions.jvmTarget = "11"
25+
kotlinOptions.jvmTarget = "17"
2726
}
2827
withType<JavaCompile> {
2928
options.encoding = "UTF-8"
30-
sourceCompatibility = "11"
31-
targetCompatibility = "11"
29+
sourceCompatibility = "17"
30+
targetCompatibility = "17"
3231
}
3332
}
3433
}
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+
};
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/browser",
18+
"@vercel/style-guide/eslint/typescript",
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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
"typescript": "^4.5.3"
10+
}
11+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
* internal (bundled by their consumer) libraries
8+
* that utilize React.
9+
*
10+
* This config extends the Vercel Engineering Style Guide.
11+
* For more information, see https://github.com/vercel/style-guide
12+
*
13+
*/
14+
15+
module.exports = {
16+
extends: [
17+
"@vercel/style-guide/eslint/browser",
18+
"@vercel/style-guide/eslint/typescript",
19+
"@vercel/style-guide/eslint/react",
20+
].map(require.resolve),
21+
parserOptions: {
22+
project,
23+
},
24+
globals: {
25+
JSX: true,
26+
},
27+
settings: {
28+
"import/resolver": {
29+
typescript: {
30+
project,
31+
},
32+
},
33+
},
34+
ignorePatterns: ["node_modules/", "dist/", ".eslintrc.js"],
35+
36+
rules: {
37+
// add specific rules configurations here
38+
},
39+
};

common/tsconfig/base.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"display": "Default",
4+
"compilerOptions": {
5+
"composite": false,
6+
"declaration": true,
7+
"declarationMap": true,
8+
"esModuleInterop": true,
9+
"forceConsistentCasingInFileNames": true,
10+
"inlineSources": false,
11+
"isolatedModules": true,
12+
"moduleResolution": "node",
13+
"noUnusedLocals": false,
14+
"noUnusedParameters": false,
15+
"preserveWatchOutput": true,
16+
"skipLibCheck": true,
17+
"strict": true,
18+
"strictNullChecks": true
19+
},
20+
"exclude": ["node_modules"]
21+
}

common/tsconfig/nextjs.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"display": "Next.js",
4+
"extends": "./base.json",
5+
"compilerOptions": {
6+
"plugins": [{ "name": "next" }],
7+
"allowJs": true,
8+
"declaration": false,
9+
"declarationMap": false,
10+
"incremental": true,
11+
"jsx": "preserve",
12+
"lib": ["dom", "dom.iterable", "esnext"],
13+
"module": "esnext",
14+
"noEmit": true,
15+
"resolveJsonModule": true,
16+
"strict": false,
17+
"target": "es5"
18+
},
19+
"include": ["src", "next-env.d.ts"],
20+
"exclude": ["node_modules"]
21+
}

0 commit comments

Comments
 (0)