Turborepo Tutorial | Part 1 - Typescript, Eslint, Tailwind, Husky shared config setup in a Monorepo

  Рет қаралды 61,697

CodeDunks

CodeDunks

Күн бұрын

Пікірлер: 91
@vcbiotech
@vcbiotech Жыл бұрын
It took me almost two weeks to finally understand my tailwind components were not working. THANK YOU SO MUCH FOR THIS.
@interceptorghost1149
@interceptorghost1149 4 ай бұрын
This video makes me level up my software engineering knowledge, nice video
@Merchance
@Merchance 3 жыл бұрын
Would be the best series if you also integrate Storybook to the workspace
@DioArsya
@DioArsya 3 жыл бұрын
yup
@gno3939
@gno3939 2 жыл бұрын
yup
@justinoneill2837
@justinoneill2837 2 жыл бұрын
yuppp! and *SVELTE* !
@ryskin82
@ryskin82 2 жыл бұрын
thats I wanted to write too
@sweetwarmblanket
@sweetwarmblanket 3 жыл бұрын
Hey Leo, I recently found you ( last month ) while looking for videos on GraphQL and your videos on GraphQL microservices and fedeartion are really amazing, I've learned a lot from it and has subscribed since the first day. I had seen your others videos and the monorepo one as well but this is something I was wanting to explore with a backend and frontend, sharing different module/plugins/husky commands using monorepo. I have learned everything from the internet and watching countless youtube videos from people like you and I really appreciate the work that you guys put in but I haven't seen a single video where someone has shown the entire procress from scratch to deploying a app ( FullStack app ) with all the industry standards. Things like, a scaleble backend and frontend fueled with typescript and graphql with proper authentication ( using cloud functions if needed ). Setting up CI/CD, docker, cloud for deployment ( AWS/Serverless ). It's a request if you could put out a video covering and explaing everything from start to finish of a FullStack ( doesn't have to be a complex a simple one like router protection with backend validation or something like that ) that'd be really helpful. Thanks again, I really appreciate your work and hope you grow to be a successful KZbinr. P.S. Happy Holidays
@CodeDunks
@CodeDunks 3 жыл бұрын
Hey R, I appreciate this message a lot! Really nice to know that my content has been able to help out. I am currently working on a full-stack course that will cover from the beginning of a project to deployment right now. I hope to have it out here soon but it is just taking a little bit of time between work, holidays, and other projects! Good luck with everything.
@sweetwarmblanket
@sweetwarmblanket 3 жыл бұрын
​@@CodeDunks I appreciate the quick reply :) and yeah, I can completely understand, time management between work and your other hustles especially during this time of the year can be really difficult at times but I'm really looking forward to it. Take care and stay up!
@rudrava
@rudrava 2 жыл бұрын
bruh u saved so much of my reading time ... best intro out there Love
@workflowinmind
@workflowinmind 2 жыл бұрын
If you've seen your watch time increase recently it might be me... I watched the whole channel! Keep it up
@musbell
@musbell 3 жыл бұрын
Thanks Leo. Looking forward for the next video.
@gregederer6945
@gregederer6945 3 жыл бұрын
This is exactly what I was looking for. Thanks!
@Feetsha
@Feetsha 2 жыл бұрын
Your content is one of the best out there ngl ! Keep up the amazing work
@milad8436
@milad8436 2 жыл бұрын
The course I was looking for. Exactly the one I wanted
@meysam0213
@meysam0213 2 жыл бұрын
tnx leo this is best practice for develop frontend monorepo,
@vedantbothikar
@vedantbothikar 2 жыл бұрын
Thanks for this video man!
@NOBOKSify
@NOBOKSify 3 жыл бұрын
literally saved my life - thank you so much!
@quyetnguyen9161
@quyetnguyen9161 3 жыл бұрын
This is awesome, thank you. Can't wait for the next video.
@footballrecap1631
@footballrecap1631 Жыл бұрын
nice one man, this was really helpful
@NotAllHeroesWearCapes-101
@NotAllHeroesWearCapes-101 3 жыл бұрын
this is super awesome .. waiting for the next part ..:)
@taghavi_script
@taghavi_script 5 ай бұрын
thanks man, i enjoyed
@andrewkorin
@andrewkorin 3 жыл бұрын
Good stuff. Keep going! Liked. Subscribed. Waiting for the next part.
@alex9471
@alex9471 2 жыл бұрын
You mean the next next part
@_kadirmetin
@_kadirmetin 8 күн бұрын
Thanks for the video 🙏
@marcellciszekdruzynski
@marcellciszekdruzynski 2 жыл бұрын
Really nice, thanks for this one !!
@b1chler
@b1chler 3 жыл бұрын
Cool man! Thanks for the intro!
@williamliu796
@williamliu796 2 жыл бұрын
Thanks so much for this video. I went absolutely nuts trying to figure out why my tailwind styles werent working through the UI library. They were being purged!!!
@codernerd7076
@codernerd7076 3 жыл бұрын
Never heard of this sounds good!
@curiousprogrammer90
@curiousprogrammer90 Жыл бұрын
Very nice and good explanations! Thanks! :)
@muratasarslan2359
@muratasarslan2359 2 жыл бұрын
Very clear & helpful. Thank you Leo 🙂
@mateh3273
@mateh3273 2 жыл бұрын
You’re the best man
@binov5012
@binov5012 2 жыл бұрын
Excellent! Thanks 🙏
@sirawichvoungchuy3128
@sirawichvoungchuy3128 3 жыл бұрын
Storybook integration would be great thank you!!
@doobtom271
@doobtom271 2 жыл бұрын
Your Christmas hat still applies at the time I watch this video, lol
@juanzapatagomez8064
@juanzapatagomez8064 2 жыл бұрын
By any chance could you make a tutorial on adding Prisma as a package?
@sokhuonguon9251
@sokhuonguon9251 2 жыл бұрын
really really good
@7iomka
@7iomka 3 жыл бұрын
Storybook integration (at least for UI components) please! Subscribed!
@cesarpintos8418
@cesarpintos8418 3 жыл бұрын
Thank you a lot christopher mintz plasse
@CodeDunks
@CodeDunks 3 жыл бұрын
😂😂😂
@bridlershoc6569
@bridlershoc6569 3 жыл бұрын
Hey great video, shared it with people! When will you release part 2?
@CodeDunks
@CodeDunks 3 жыл бұрын
Hey there and thanks! I plan to release it sometime next week. Was just gone for the hoildays visiting family.
@PartneredAdmin
@PartneredAdmin 5 ай бұрын
Hi how to add a new app using a command e.g. npx create-payload-app@latest as an app to a turborepo? I can 't find this anywhere clearly? So...is it just delete the node_modules and copy/move all the new app files to /apps and add name and version to the workspaces?
@fooked1
@fooked1 2 жыл бұрын
May I ask, why did you include the same dependencies in both next package.json files? Wouldn't it be better to move those deps to a common package.json -- perhaps the root package.json?
@alexandardimcevski9136
@alexandardimcevski9136 Жыл бұрын
How do we add Font to the UI package and the Apps?
@MrEnsiferum77
@MrEnsiferum77 3 жыл бұрын
Is it possible to remove deps and devDeps from packages and apps folder, and reuse what u can reuse from root package.json file, like typescript, react, react-dom and turrbo repo on build step to find all root depedencies?
@CodeDunks
@CodeDunks 3 жыл бұрын
I believe that you should be able to reuse devDependencies, removing dependencies however might be a little bit more complicated. I found this interesting issue on the Lerna repo that might explain github.com/lerna/lerna/issues/1079. I haven't had to do this with turborepo yet so I am not 100% sure.
@MrEnsiferum77
@MrEnsiferum77 3 жыл бұрын
@@CodeDunks I've managed to solve with shared dependencies like react, react-dom installed in packages/shared, and shared imported in apps/remix as "shared": "workspace:*, because I'm using pnpm... Now I have issue with finding every devDeps binary except eslint, like rimraf. Packages exists inside apps/remix node_modules folder, and I can see them as symlinks, but for some reason, is not working recursively. Opened discussion for help on github.
@CodeDunks
@CodeDunks 3 жыл бұрын
@@MrEnsiferum77 sounds like quite the setup, could you link the issue so I can follow as well? Got me interested
@MrEnsiferum77
@MrEnsiferum77 3 жыл бұрын
@@CodeDunks That eslint command, gets me tricky. Some other package from remix or directly remix isntalling eslint binary, that's why its is found. The problem is with pnpm, which is not possible to have subfolder dependencies and to be found upstream as binaries. U need to installed all of them in root package.json. I still trying to figure it our if monorepos tools or npm/yarn/pnpm can make binaries avaiabled installed in one packaged, into another one, which imports it. I'm planing to make turborepo monorepo with multiple techonologies as template, so probably when I'm done will be part of turborepo templates.
@CodeDunks
@CodeDunks 3 жыл бұрын
@@MrEnsiferum77 Hmm interesting, I haven't had a chance to use pnpm yet but hope to get to it soon. Appreciate all the information and look forward to that repo once you have it done!
@abdullahclementabdulshekur6736
@abdullahclementabdulshekur6736 Жыл бұрын
can this set up be used to build microservices
@sourav_-_7038
@sourav_-_7038 2 жыл бұрын
instead of next-app and next-next-app can you use mf-proj1 and mf-proj2
@martinlupa8692
@martinlupa8692 Жыл бұрын
Hi Leo, great material. I am setting up a monorepo for a side project and this video helped me a lot to understand the shared configurations between projects. I have a question that I couldn't answer yet. When setting up the shared eslint config, why is it important to let "prettier" to the last in the extends array inside eslint-next.js? I have come across other projects that do not respect that ordering and was wondering why. Thanks a lot!
@CodeDunks
@CodeDunks Жыл бұрын
Hey Martin! Thanks for the kind words, from my understanding eslint applies configurations sequentially. Since prettier is pretty opinionated formatter, it can conflict with your other ESLint rules, putting it at the end ensures that prettier always "wins" and formats your code
@martinlupa8692
@martinlupa8692 Жыл бұрын
@@CodeDunks thanks again!
@lukafireman
@lukafireman 2 жыл бұрын
Hey man, Awesome content!! Mind sharing details about your workspace setup? What you use to set up your Workspaces, VSCODE, OS, Extensions, etc. Including that lovely terminal of yours.
@hakanaki
@hakanaki 2 жыл бұрын
Why can't Turborepo packages work with plane React 😥😥?
@alexand215
@alexand215 3 жыл бұрын
thank you so much
@lamogura
@lamogura 2 жыл бұрын
I am curious what you would do if you are using a tailwind plugin or extending the theme etc only on the UI components? Or vice-versa? Would that still all work as expected? It seems only autocomplete etc is playing nice because you copy/pasted the same config to both places. The approach is different than how you did tsconfig, so I guess there isnt a way to put all the tailwind config in 1 place and share?
@CodeDunks
@CodeDunks 2 жыл бұрын
I think you are asking about whether you could have a shared config? I found this article that might help tinypixel.dev/use-yarn-workspaces-to-share-a-tailwind-config-file-throughout-your-wordpress-application/
@Jamie-kf2vf
@Jamie-kf2vf 3 жыл бұрын
Question; I have a Nextjs app currently (not a monorepo). If I create a Turborepo monorepo, could I just drag my NextJS project into the apps/ directory? It already has all the eslint and prettier config.
@SivakD
@SivakD 3 жыл бұрын
Hey. Very nice video. I've been using this tool too and it seems good. Do you know if there's a way to specify a build order for apps that might depend on packages in the package folder? (e.g. if app A needs package A, it has to build that package before trying to build app A) Is it the pipelining or just the order of the build scripts? Thanks in advance.
@CodeDunks
@CodeDunks 3 жыл бұрын
Yeah I believe you should be able to use the "dependsOn" pipeline configuration specificPackageTasks. So like you could do something like in "pipeline" "appA#build": { "dependsOn": ["packageA#Build"] } Check it out here turborepo.org/docs/features/pipelines
@SivakD
@SivakD 3 жыл бұрын
@@CodeDunks Thanks for the reply. I was playing with it some and the pipeline is definitely the way to go as well as having dependencies defined in the app's package.json itself. I'm new to monorepos but I am liking this tool thus far.
@meysam0213
@meysam0213 2 жыл бұрын
how to integrate storybook with this ?
@lcui4813
@lcui4813 3 жыл бұрын
nice video! do you know how to make vscode autoimport working in this video's monorepo? now i need to manually import once then it works
@CodeDunks
@CodeDunks 3 жыл бұрын
Hmm I don't think I have ever used that extension unfortunately
@ngoclam98242
@ngoclam98242 Жыл бұрын
sorry but can you explaint, why we use "./../packages/ui/**/*.{ts,tsx}" not "./packages/ui/**/*.{ts,tsx}"
@ishanagarwal3464
@ishanagarwal3464 2 жыл бұрын
Great video, I am very new to this, could you please tell advantages of turborepo over simple monorepo? Any is sharing ts config possible without turborepo?
@LarsRyeJeppesen
@LarsRyeJeppesen Жыл бұрын
Caching. If you want more advanced stuff, go with NX which is superior but more advanced/complex
@siya.abc123
@siya.abc123 2 жыл бұрын
Great tutorial thank you. But, so many configs are intimidating
@hirisraharjo
@hirisraharjo 2 жыл бұрын
How to do it without tailwind? (ex: purgecss only) Anyway great video as usual!
@LarsRyeJeppesen
@LarsRyeJeppesen Жыл бұрын
I really hate how TurboRepo is so associated with NextJS. It is like they try to force to use that all the time. It would have been nice if you didn't set it up with the default NextJS, because anyone not using it cannot use the same approach as you did.
@dimitrisefstathiadis6562
@dimitrisefstathiadis6562 2 жыл бұрын
Your root commands should run yarn workspaces lint, and then run it for all packages. What you are doing there while correct is not reproducible..
@jamielee4427
@jamielee4427 2 жыл бұрын
Well this is simply brilliant! Thanks man. Btw, just to point out, prettier doesn't format on save for me unless I create a .vscode/settings.json and have the following config: { "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.fixAll.eslint": true, "source.organizeImports": true } } This is fine, but more for those who aren't aware. I had a Next project with this set up but the Turborepo one didn't. Question - when I save a file, will it apply the correct prettier configuration? (say, you have one in next-app which is different to next-next-app).
@CodeDunks
@CodeDunks 2 жыл бұрын
Thanks Jamie! You could also add those settings to your overall VSCode settings I believe so it doesn't need to be per project basis. 1. CTRL + Shift + P -> Type settings and open Settings (JSON) 2. Paste "editor.formatOnSave": true, "eslint.format.enable": true, "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, "eslint.options": { "extensions": [".js", ".jsx", ".md", ".mdx", ".ts", ".tsx"] }, "eslint.validate": [ "javascript", "javascriptreact", "typescript", "typescriptreact", "markdown", "mdx" ], That is what I have in my settings (JSON), might work for you. Sorry if it doesn't haha
@omkarkulkarni3644
@omkarkulkarni3644 3 жыл бұрын
eslint not working unfortunately
@CodeDunks
@CodeDunks 3 жыл бұрын
What seems to be the issue?
@shashwatgupta9993
@shashwatgupta9993 2 жыл бұрын
Same... did you find any solution?
@shashwatgupta9993
@shashwatgupta9993 2 жыл бұрын
@@CodeDunks getting this error but don't know how to solve it. Could not find a declaration file for module 'config/eslint-next.js'. '/Users/shashwat/Desktop/Turborepo/turborepo tailwind with jit-mode/packages/config/eslint-next.js' implicitly has an 'any' type. Try `npm i --save-dev @types/config` if it exists or add a new declaration (.d.ts) file containing `declare module 'config/eslint-next.js';`
@shashwatgupta9993
@shashwatgupta9993 2 жыл бұрын
it works on putting noimplicitany to false but i want strict type checking
@CodeDunks
@CodeDunks 2 жыл бұрын
@@shashwatgupta9993I ran into the same issue where the linting was actually not linting anything. I've updated the repository with a version that should be working. github.com/leoroese/turborepo-tutorial
@fortunatmutunda4194
@fortunatmutunda4194 2 жыл бұрын
This is what you don't find in the offical docs.
@dimitrisefstathiadis6562
@dimitrisefstathiadis6562 2 жыл бұрын
100% sure these configs are gonna change in v2 of turbo repo and will pivot to the way Nx has them. They confused themselves a bit and made the configs too complex.
@CodeDunks
@CodeDunks 2 жыл бұрын
Yeah they've changed already lol. Turborepo now defaults to a turbo.json, if you happen to have an older version before that change, they also provide a command to update automatically to turbo.json
@dealerpriest
@dealerpriest 2 жыл бұрын
The number of times you can skip saying the words "go ahead" is overwhelming. Those words are, in most part, just fluff😊
@markokraljevic1590
@markokraljevic1590 Жыл бұрын
you should talk slower, sounds like you are nervous
@peroconino
@peroconino 2 жыл бұрын
Its pretty hard to find content about monorepos on the internet, this video helps a lot understanding how it works. But unfortunately the solutions may deprecate with time. I was following your steps to configure eslint (tsconfig worked just fine) and the part where you configure the import resolver seems not to be working anymore. But it actually got easier to do it. I didn't had to override parserOptions in eslint.js project level. I just had to pass to next-preset.js at settings>import/resolver>typescript a property called project and there specify the path to next project like this : project: ["./apps/next-app/tsconfig.json"]. And worked just fine to recognize the absolute paths from tsconfig. Hopefully this helps someone in the future with the same problem I had.
Deploying Turborepo on Google Cloud Run
33:36
Build Tech
Рет қаралды 1,8 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
What is Promise chaining in JavaScript
9:37
The Fullstack Project
Рет қаралды 53
ESLint Setup Made EASY! (For Beginners)
22:04
The Common Coder
Рет қаралды 9 М.
How to structure a JS/TS monorepo (From Zero to Turbo - Part 1)
11:58
Why use a monorepo?
6:32
Vercel
Рет қаралды 109 М.
All 17 React Best Practices (IMPORTANT!)
1:46:11
ByteGrad
Рет қаралды 219 М.
Getting started with Turborepo
34:31
Hamed Bahram
Рет қаралды 48 М.
SvelteKit Turborepo with a shared component library
24:06
Ken Jones Pizza
Рет қаралды 4,3 М.