Turborepo with Tailwind CSS setup for shared ui components.

  • By George Carl
  • Last update: Jan 2, 2023
  • Comments: 1

Turborepo starter

This is an official Yarn v1 starter turborepo.

What's inside?

This turborepo uses Yarn as a package manager. It includes the following packages/apps:

Apps and Packages

  • docs: a Next.js app
  • web: another Next.js app
  • ui: a stub React component library shared by both web and docs applications
  • config: eslint configurations (includes eslint-config-next and eslint-config-prettier)
  • tsconfig: tsconfig.jsons used throughout the monorepo

Each package/app is 100% TypeScript.

Utilities

This turborepo has some additional tools already setup for you:

Setup

This repository is used in the npx create-turbo command, and selected when choosing which package manager you wish to use with your monorepo (Yarn).

Build

To build all apps and packages, run the following command:

cd my-turborepo
yarn run build

Develop

To develop all apps and packages, run the following command:

cd my-turborepo
yarn run dev

Remote Caching

Turborepo can use a technique known as Remote Caching (Beta) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.

By default, Turborepo will cache locally. To enable Remote Caching (Beta) you will need an account with Vercel. If you don't have an account you can create one, then enter the following commands:

cd my-turborepo
npx turbo login

This will authenticate the Turborepo CLI with your Vercel account.

Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your turborepo:

npx turbo link

Useful Links

Learn more about the power of Turborepo:

Github

https://github.com/cvrlnolan/turborepo-tailwindcss

Comments(1)

  • 1

    Not works fine....

    Hi!

    I have cloned the project, installed the dependencies. Once finished I have tried the "yarn lint" and it has started to give a lot of errors.

    web:lint: web:lint: ./pages/index.tsx web:lint: 1:30 Error: Delete prettier/prettier web:lint: 2:29 Error: Delete prettier/prettier web:lint: 3:1 Error: Delete prettier/prettier web:lint: 4:32 Error: Delete prettier/prettier web:lint: 5:11 Error: Delete prettier/prettier web:lint: 6:7 Error: Delete prettier/prettier web:lint: 7:13 Error: Delete prettier/prettier web:lint: 8:31 Error: Delete prettier/prettier web:lint: 9:14 Error: Delete prettier/prettier web:lint: 10:1 Error: Delete prettier/prettier web:lint: 11:77 Error: Delete prettier/prettier web:lint: 12:54 Error: Delete prettier/prettier web:lint: 13:53 Error: Delete prettier/prettier web:lint: 14:21 Error: Delete prettier/prettier web:lint: 15:15 Error: Delete prettier/prettier web:lint: 16:13 Error: Delete prettier/prettier web:lint: 17:8 Error: Delete prettier/prettier web:lint: 18:5 Error: Delete prettier/prettier web:lint: 19:2 Error: Delete prettier/prettier web:lint: web:lint: ./pages/_app.tsx web:lint: 1:1 Error: Run autofix to sort these imports! simple-import-sort/imports web:lint: 1:42 Error: Delete prettier/prettier web:lint: 2:31 Error: Delete prettier/prettier web:lint: 3:1 Error: Delete prettier/prettier web:lint: 4:53 Error: Delete prettier/prettier web:lint: 5:39 Error: Delete prettier/prettier web:lint: 6:2 Error: Delete prettier/prettier web:lint: 7:1 Error: Delete prettier/prettier web:lint: 8:22 Error: Delete prettier/prettier web:lint: web:lint: info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules docs:lint: docs:lint: ./pages/index.tsx docs:lint: 1:30 Error: Delete prettier/prettier docs:lint: 2:29 Error: Delete prettier/prettier docs:lint: 3:1 Error: Delete prettier/prettier docs:lint: 4:33 Error: Delete prettier/prettier docs:lint: 5:11 Error: Delete prettier/prettier docs:lint: 6:7 Error: Delete prettier/prettier docs:lint: 7:13 Error: Delete prettier/prettier docs:lint: 8:41 Error: Delete prettier/prettier docs:lint: 9:14 Error: Delete prettier/prettier docs:lint: 10:1 Error: Delete prettier/prettier docs:lint: 11:77 Error: Delete prettier/prettier docs:lint: 12:54 Error: Delete prettier/prettier docs:lint: 13:54 Error: Delete prettier/prettier docs:lint: 14:21 Error: Delete prettier/prettier docs:lint: 15:15 Error: Delete prettier/prettier docs:lint: 16:13 Error: Delete prettier/prettier docs:lint: 17:8 Error: Delete prettier/prettier docs:lint: 18:5 Error: Delete prettier/prettier docs:lint: 19:2 Error: Delete prettier/prettier docs:lint: docs:lint: ./pages/_app.tsx docs:lint: 1:1 Error: Run autofix to sort these imports! simple-import-sort/imports docs:lint: 1:42 Error: Delete prettier/prettier docs:lint: 2:31 Error: Delete prettier/prettier docs:lint: 3:1 Error: Delete prettier/prettier docs:lint: 4:53 Error: Delete prettier/prettier docs:lint: 5:39 Error: Delete prettier/prettier docs:lint: 6:2 Error: Delete prettier/prettier docs:lint: 7:1 Error: Delete prettier/prettier docs:lint: 8:22 Error: Delete prettier/prettier docs:lint: docs:lint: info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules web:lint: error Command failed with exit code 1. web:lint: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. docs:lint: error Command failed with exit code 1. docs:lint: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. web:lint: ERROR: command finished with error: command (apps\web) yarn run lint exited (1) command (apps\web) yarn run lint exited (1)

    I assume you are referring to carriage returns. I have tried to fix it with the "yarn format".

    I run the "yarn lint" again:

    λ yarn lint yarn run v1.22.19 $ turbo run lint 2022/07/16 14:15:05 [WARNING] Turbo configuration now lives in "turbo.json". Migrate to turbo.json by running "npx @turbo/codemod create-turbo-config" • Packages in scope: config, docs, tsconfig, ui, web • Running lint in 5 packages web:lint: cache miss, executing eefdc824cc84263f docs:lint: cache miss, executing 111aa5ccc7031670 web:lint: $ next lint docs:lint: $ next lint web:lint: web:lint: ./pages/_app.tsx web:lint: 1:1 Error: Run autofix to sort these imports! simple-import-sort/imports web:lint: web:lint: info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules docs:lint: docs:lint: ./pages/_app.tsx docs:lint: 1:1 Error: Run autofix to sort these imports! simple-import-sort/imports docs:lint: docs:lint: info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules web:lint: error Command failed with exit code 1. web:lint: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. docs:lint: error Command failed with exit code 1. docs:lint: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. docs:lint: ERROR: command finished with error: command (apps\docs) yarn run lint exited (1) web:lint: ERROR: command finished with error: command (apps\web) yarn run lint exited (1) command (apps\docs) yarn run lint exited (1) command (apps\web) yarn run lint exited (1)

    Tasks: 0 successful, 2 total Cached: 0 cached, 2 total Time: 4.298s

    error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. It should now pass the linter without problems but it still gives errors. I assume you are referring to the order of imports. Shouldn't the prettier fix it already? Is there any way to fix it?

    Thank you very much!