-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work with dependency of dependency #16
Comments
Does |
Hi, did you close this as I haven't replied? Sorry, I stopped using I could try and setup a test repo if I get the time, but basic |
Yes if you want yalced package
|
Ok, maybe |
You can just add all needed packages as yalc dependency for the root package. If you don't publish code in project's |
This didn't work well for me. It means I have two versions of the package installed and deduping not working nicely with the TS packages I'm trying to fix for some reason. |
@elie222 can you elaborate on you issue? you have problems with inner There is a bug currently in |
Well I tired using .yalc in a package that imports from another package.
But had problems with that, the same as others.
I also tried adding both yalc packages to the main project, but left me
with 2 versions of a package in my project at which typescript started
complaining about duplicate declarations.
…On Mon, 24 Dec 2018, 16:26 Alex ***@***.*** wrote:
@elie222 <https://github.com/elie222> can you elaborate on you issue? you
have problems with inner .yalc packages of the package published with
yalc?
There is a bug currently in npm-packlist module that may not include
package.json file of the inner folder in published content. Actually I've
fixed it but not published yet.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AC8oX06sh9RVK212EUGehkTsvP35jq9Kks5u8OQvgaJpZM4SKri3>
.
|
This should not be the case now.
Well actually I don't really get what issues really are. If it is about absence of |
Sorry, could you explain how nested packages are supposed to work with
yalc? Are they supported or not? And if they are, what are the steps to
getti g nested packages working?
…On Mon, 24 Dec 2018, 16:42 Alex ***@***.*** wrote:
@Worthaboutapig <https://github.com/Worthaboutapig>
Could not install from ".yalc/project-b/.yalc/project-c" as it does not
contain a package.json file
This should not be the case now.
@elie222 <https://github.com/elie222>
Well I tired using .yalc in a package that imports from another package.
But had problems with that, the same as others.
Well actually I don't really get what issues really are. If it is about
absence of package.json in nsted packages, this should not be the case
now. yalc is really very simple and transparent, there is no magic inside
which could provide unexpected side effects.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AC8oX7JU14JvmuTY1EIfwfYYJGuk5Xz8ks5u8OfWgaJpZM4SKri3>
.
|
@elie222 it depens what is meant by nested packages. Say So you will have
So then you do Not sure what else is meant by "nested" packages. |
Ok thanks. Hopefully works well next time I run into this issue.
…On Mon, 24 Dec 2018, 18:31 Alex ***@***.*** wrote:
@elie222 <https://github.com/elie222> it depens what is meant by nested
packages say A package that you are going to publish/use with yal and B
is package that you add to to A using yalc
So you will have
/ A (root)
.yalc/
B/..
package.json <- this will probably contain `"B": "file:.yalc/B"`
So the you do yalc publish in A it wilt publish A package which will
contain .yalc/B folder and thus *nested* B package will be used.
Not sure what else is meant by "nested" packages.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AC8oX2I6Wl75zV0QqiQSNyH8ALvrBtcRks5u8QFvgaJpZM4SKri3>
.
|
I'm running into the same issue. I have a project A depending on a project B which depends on a project C. I ran:
I'm using the latest yalc version 1.0.0-pre.27. I do not see any nested .yalc directory inside I did this with a pretty simple project setup, but let me know if you are unable to repro for some reason. |
@whitecolor can we re-open this please? Looks like ppl are still having problems. See comment from @yang for reproducible steps. Thanks! |
This is due to the relative path to the .yalc directory. When If you manually change |
I'm not sure how you're getting those results @whitecolor. I'm on OSX using v1.0.0-pre.31 and when I perform the same steps there is no nest_a/.yalc/nest_b/.yalc directory - my results match yangs results. Copying it over manually is manageable as a work around but I'd definitely like to know more about how that's working for you several other folks in this thread have been unable to get those results. |
I believe I have the same problem with v1.0.0-pre32 (and previous versions). in my case, I have two projects that the same dependency, A and B both require C, but also B requires A, so: A has dependencies: C I am working on project C, but I have to test it using Project B. So... From project C: build and and finally, in project B:
My only workaround is to manually update project B's |
I will also chime in that I am experiencing this issue. It's an issue with the relative paths in the package.json. If yalc would use absolute paths with its file:/ adding, everything would work perfectly. |
I solved my issue with this using "resolutions": {
"@ckeditor/ckeditor5-upload": "file:.yalc/@ckeditor/ckeditor5-upload"
} |
same problem here |
I'd like to add that I recently encountered this issue as well. Here's how I have things setup: Project Order of operations:
I was able to fix this by adding:
|
any updates on this issue? |
No, as the problem is not clear to me. |
After trying this and other solutions for local modules I settled with Lerna, works with either NPM or Yarn |
Yalc can hardly be considered as an alternative to Lerna or alike tooling. It's just for quick grabbing a local (under development) package content and injecting it into your project(s). It tends to deal with simple and independent packages. When you have yalc dependencies inside the package you want to inject probably there may be some issues, but still, it should be all transparent and resolvable. |
I wonder how yalc should solve those "problems"? |
@wclr I believe I found one cause to this issue and am willing to create a PR if you're open to it. one cause is if package.json -> files does not contain '.yalc' then nested dependencies breaks. This is due to the published repo not containing the '.yalc' directory Here's a very simple reproduction git clone git@github.com:olsonpm/yalc-nested-issue.git
cd yalc-nested-issue
./repro.sh
...
Error: Cannot find module 'b'
Require stack:
- /path/to/yalc-nested-issue/root/.yalc/a/index.js where the expected output is |
For what it's worth, this is the main reason I created my "wrapper around yalc" that I named zalc: https://github.com/Venryx/zalc Basically, it monkey-patches yalc so that when you run While I can give more detailed instructions on how to set zalc up for this purpose is needed; zalc's entire source-code is only 41 lines long atm though, so that may be unnecessary: https://github.com/Venryx/zalc/blob/master/Source/Bin.ts |
@olsonpm I checked the repro. first, you need to include second, but this is actually the way npm works, don't know why it doesn't install file:.yalc/b that is in The strange thing though run npm twice (change |
why would users be expected to add '.yalc' to package.json -> files ? shouldn't yalc be responsible for that given it's required for nested dependencies to work ? and also you wouldn't want to publish yalc files to npm, it is a local dev tool. I'll look into the |
No, yalc totally mimics npm pack/publish behavior here, it is by design. If you wan't to publish such package to the npm you probably would want .yalc folder to be included there too. Yalc works simple here, I don't see a reason to introduce some ad-hoc logic to handle nested yalc dependencies, this will only complicate things. |
the reason would be to support the use-case that a lot of people seem to have. It's understandable you don't want to support that use-case, but then I think a lot of us on this thread would prefer a fork which is totally fine. I enjoy working with this lib |
So what do you lack for the use-case? Is there a problem with including |
the problem is that yalc should handle that itself, it should not require the user to add '.yalc' to the list of npm published files. Users should not be publishing files to npm which are specifically meant for local development |
A "compromise" would be to at least allow users to tell yalc they want to have the Currently, there is no way to tell yalc to respect the above entries, because of the way it parses the Line 155 in 12e3ef3
|
I'm afraid this is not true, the fact that one uses yalc dependency in the package doesn't mean that it is strictly "for local development", one may want to publish it to the remote registry as well including .yalc content and deps. And we should try to keep consistency in terms of included content here.
So I explained why it is not a valid point. Anything else preventing from adding .yalc explicitly to package content? (esp. if you are not going to publish to the remote registry)
This too would make local publishing less consistent with remote (remote content should be >= local to prevent potential lack of files). |
Yes, processing Usage of those entries would be:
(If you're worried people will "accidentally" re-include files for local publishes only, when they actually were supposed to add those entries to the package.json |
I just currently fail to see why the existing behavior is not sufficient to cover the use case to make proposed changes (either auto include |
With the current behavior, there are two options for what to do with the
What I and some others want (at least as an option): Why would we want option 3 rather than the existing two options? Well, here are my reasons that option 1 and 2 are insufficient:
|
I'm not proposing to include not-needed content when publishing to remote. If you want to publish without |
No; what I do is I have
What this accomplishes: When yalc is used locally, Yarn notices the folders in |
i suppose we'll see how many people that use this lib feel comfortable publishing content intended for local development out to the public registry. i think the yalc files have no place there and i feel others with this use case will feel similarly. i will use my fork as a result |
If you package.json doesn't have any references to packages located in
That depends on your perspective for what it is intended. What your fork is going to do, include |
It doesn't have references hard-coded into the
It auto-links the modules in the So it achieves "user-specific yalc-inclusions". (ie. including the modules that the user did |
I use |
Yes.
Because that's the smoothest way I know to have the packages in
It is used to have Yarn symlink to a locally-modified version of the subdependencies (the copy in the shallow dependency's I'm not sure what part of the explanation is missing? (If you mean, how do I tell yarn to do that symlinking -- it does it automatically. Perhaps it's not supposed to? But anyway, it does, because I'm currently using it this way in multiple projects.) |
I'm not asking about this, this is how yarn workspaces work inside a project. What I'm asking: In your project |
Yes; that "project A" "bundles" a lot of my custom packages (as well as various other commonly used packages) as subdependencies, for consistent versioning of them all together -- but with yalc in-use so that I can swiftly apply local modifications to any of those subdependencies, through that "bundling package" (ie. "package A" in your text). |
Yes, that is a good idea; I'll try to get to it eventually. (I'm backlogged in development tasks atm, and my "zalc" wrapper currently gets the job done, but I'll keep it in mind.) |
For anybody who might be stuck with this "nested dependencies" issue, this worked for me. For each dependency that has nested dependencies, add
and run |
I don't know why you are complicating this so much |
Supposing I have a main project A which has a dependency on Project-B, which in turn has a dependency on Project-C. Both Project-B and Project-C are managed as yalc dependencies.
npm install
throws an error such as:Could not install from ".yalc/project-b/.yalc/project-c" as it does not contain a package.json file.
When installing the reference to
project-c
, theproject-b
.yalc
folder is the same as usualfile:.yalc/project-c
- however, this is then attempting to reference the dependent project within the project copied to the.yalc
folder, however, it should be referencing the yalc folder from the root of the.yalc
inproject-b
instead.Basically, if you have a project in your
.yalc
folder that references another project in the.yalc
repository, then it will incorrectly assume the referenced project is at the same level, when it should be looking to the root yalc folder in the parent project (i.e.project-a/.yalc
)The text was updated successfully, but these errors were encountered: