Lightning Fast PNPM Workspaces

Поделиться
HTML-код
  • Опубликовано: 30 янв 2025

Комментарии • 27

  • @nxdevtools
    @nxdevtools  Год назад +1

    Here's a couple of useful links: Git
    Github example repo: github.com/juristr/jsnation-pnpm-workspace-nx
    Package based tutorial: nx.dev/tutorials/package-based-repo-tutorial

  • @amosdottv
    @amosdottv Год назад +1

    I've only ever used the integrated Nx monorepo setup before, but was wondering if there is a way to use Nx's generators with a package-based setup? Or do you have to manually create the directory, add tsup, set up the package.json etc.?

    • @Supaship6000
      @Supaship6000 Год назад +3

      Yup!! The Nx generator API is awesome (imo) and is great for generating projects for package-based solutions. We don't have first-party package-based generators yet, but you can absolutely make your own.

  • @fernaspiazu
    @fernaspiazu 5 месяцев назад +1

    Everything nice! But how do bundle ONLY nextapp or remixapp in a Docker image without bringing workspace folders like packages? Because I found several problems with symlinked dependencies and other components in my workspace that aren't shipped in the application I want to deploy independently.

  • @AlexanderMazuruk
    @AlexanderMazuruk Год назад +1

    you've got it done in 6 minutes! don't lie to us

    • @nxdevtools
      @nxdevtools  Год назад +1

      actually, the Nx part was just 50 secs 😉 - Juri

    • @Supaship6000
      @Supaship6000 Год назад

      You should see Juri's typing speed tests lol!

  • @cmichaelgraham
    @cmichaelgraham Год назад +2

    your videos are awesome 😎

  • @abdelhakimmhioul9711
    @abdelhakimmhioul9711 Год назад +1

    Very good tutorial, thanks for the team, I have one question, how do I build nested monorepos using NX and PNPM? I'm trying to manage a monorepo (one shared library between two monorepos)

    • @Supaship6000
      @Supaship6000 Год назад +1

      Hey man! Best option is to just not nest monorepos. If you can join and flatten the repos, that's almost always better, but not always an option.
      If you can't for whatever reason, I'd just publish the one shared library to a registry and have it as a dependency for your 2 monorepos. Git submodules are a thing too, might match what you're looking for, but there's alot of pain down that route.

  • @SRG-Learn-Code
    @SRG-Learn-Code Год назад +1

    One "stupid" question. I'm trying to collaborate on a project that is somehow related to 2 repos that depend on each other. I want to make a monorepo, but the project is not mine and I don't want to impose my workflow to the authors, so... I'm doing a monorepo and then forking those repos, to my packages folder. In theory I still can do separate commits to each repo but I'm not sure how to implement this. I'm pretty sure I'm doing something wrong, do I have to commit the git folder? I don't commit the packages folder but add an step to autoclone those folders?. Have anybody done something like this?

    • @Supaship6000
      @Supaship6000 Год назад

      Not a stupid question!
      What you're describing is actually SUPER close to git submodules. Check it out, but there's alot of pain involved with this approach (we often recommend monorepos instead of submodules for this reason).

    • @SRG-Learn-Code
      @SRG-Learn-Code Год назад

      @@Supaship6000 I'm feeling the pain already...
      Anyways, thanks!, just knowing there is something already in this regards makes me thinks im not crazy! I'll check it out.

    • @Supaship6000
      @Supaship6000 Год назад

      @@SRG-Learn-Code yeah it's one of those things that seems really cool the first time I saw it, but you start to notice the wrinkles REAL quick when you get into it!

    • @SRG-Learn-Code
      @SRG-Learn-Code Год назад

      @@Supaship6000 I see the pain now... watch?v=PKts7yCmlWk

    • @SRG-Learn-Code
      @SRG-Learn-Code Год назад

      How would yo do it?

  • @bananaisadonut
    @bananaisadonut Год назад +1

    This is a great video. I have already done this a few months ago based on some article I have read nx posted. It works fantastic. I have had some issues though configuring when I have an application that has hot/live reloading and a dependencies that is pointing to a workspace project. For example, If I have a nextjs application under `apps/example` and then I have a ui library under `libs/core-ui`. When I run `nx dev example` it will run `next dev` for that project. If I update a dependent workspace project, it will not hot reload. While I understand why I just wanted to see if it is possible to get done without have nx build the application for you. Since I want to run next dev. I have a attempt the `nx` key in my package.json and I dont want to use the project.json configuration I know you can pass and get working. I also know you can configure to use chokidar to look at dependent libraries. I just didnt know if there was a way built in to do this or it is just frowned on since you core libs/apps should be scope to themselves?

    • @Supaship6000
      @Supaship6000 Год назад +4

      hey @bananaisadonut - if you're using `next dev` then checkout the transpilePackages inside of your `next.config.js`. If you opt for the `@nx/next` package, you can use our executor that will detect which internal packages you're referencing automatically!

  • @DennisHellwig
    @DennisHellwig Год назад +1

    We need a solution for HMR in dev mode for all dependencies! Usually, entry files point to the dist folder of each package which makes HMR impossible.

    • @nxdevtools
      @nxdevtools  Год назад +2

      “real” HMR might be tough, but we recently added the ability to “watch” dependencies and auto-rebuild them: nx.dev/recipes/other/workspace-watching

  • @RalphHurndon-w5x
    @RalphHurndon-w5x 5 месяцев назад

    Gorczany Corner