Git Product home page Git Product logo

Comments (9)

robgraeber avatar robgraeber commented on September 27, 2024 1

@ctrlplusb It's pretty easy getting yalc to working sustainably for a monorepo.

For example I have a postinstall script setup:

"scripts": {
    "postinstall": "yarn workspaces foreach exec yalc publish --push",
  },

Then you yalc add in the projects you need it in and commit the yalc.lock file and ignore the .yalc folder.

Now whenever you make a change in a sibling package you would yarn to propagate the change.

from yalc.

robgraeber avatar robgraeber commented on September 27, 2024 1

@wclr workspace symlinks/hoisting aren't great because often times multiple versions of a library can't coexist together. For example I have a monorepo package that has React as a dev dependency but Yarn workspace will symlink along the node_modules folder too when I use the package elsewhere and that causes all kinds of problems.

from yalc.

wclr avatar wclr commented on September 27, 2024

In most cases I commit yalced packages into git. So, I use yalc as a way to install some "permanent" stuff in (usually monorepo) projects, the stuff that is managed by me, that is in dev mode and not published for a shared consumption.

from yalc.

ctrlplusb avatar ctrlplusb commented on September 27, 2024

Ah I see, so the .yalc folders that are local to each package, along with their yalc.lock files will be committed to git? I guess I could live with that yeah.

So it would be something like this right;

my-mono-repo
|- .git
|
|- apps
|  |
|  |- @my/mobile-app
|     |- .yalc
|     |  |- @my/components
|     |- src
|     |- package.json
|     |- yalc.lock
|
|- packages
|  |
|  |- @my/components
|     |- src
|     |- package.json
|
|- package.json

What about rehydrating a user's global yalc store? Say another team member does a fresh checkout. They would need to rehydrate the store right and somehow rebuild the installation tree so that they can do subsequent yalc push'es. Do you have a workflow around this too?

I feel like I almost want the yalc store to be local to the monorepo root, but then I am apprehensive to commit that to git too. 😅

from yalc.

wclr avatar wclr commented on September 27, 2024

Ah I see, so the .yalc folders that are local to each package, along with their yalc.lock files will be committed to git?

I prefer a single .yalc folder for a project.

What about rehydrating a user's global yalc store? Say another team member does a fresh checkout.

I don't think that yalc plays nicely with team's workflows.

I'm not sure what you are trying to accopmlish. For using packages across a monorepo I use workspaces feature. Yalc is for installing external stuff.

from yalc.

ctrlplusb avatar ctrlplusb commented on September 27, 2024

For using packages across a monorepo I use workspaces feature. Yalc is for installing external stuff.

Yeah, I'm explicitly trying to avoid workspaces. I don't want to leverage hoisting. My goal is to try to enable monorepo style development whilst utilising yalc to manage the dependencies between the packages of the monorepo.

from yalc.

ctrlplusb avatar ctrlplusb commented on September 27, 2024

@wclr - I'm riffing on some ideas for a complementary CLI on top of yours, which is specific to my usecase. The readme describes this theoretical package;

https://github.com/ctrlplusb/yalcd

What do you think? Any concerns or objections?

Readme driven development ™️

from yalc.

wclr avatar wclr commented on September 27, 2024

Yeah, I'm explicitly trying to avoid workspaces. I don't want to leverage hoisting.

What is the real problem with workspaces/hoisting? I usually use PNPM for managing monorepos.

from yalc.

justsaul avatar justsaul commented on September 27, 2024

Although issue is resolved, i would just like to add to @robgraeber comment. I'm dealing with same issue - devDependencies. This is really painful in yarn workspaces. Ideally, yes, you would sync dependencies, however that is not feasible in big monorepos that may contain multiple packages and projects.

from yalc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.