-
Notifications
You must be signed in to change notification settings - Fork 334
Conversation
Another issue that can be resolved by this PR: #482 Limitation: As long as there is an existing "webpack.config.json" in the worker dir, users can successfully execute any cli subcommands (dev, build etc.) without triggering local "npm install". If there is none cli will be seeking package.json. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@ags799 np, glad I could be of help! |
@ags799 any timeline for this change to be released? Not rushing things - just want to use this in a monorepo! |
Within a week!
…On Thu, Feb 11, 2021 at 11:34 AM Filip Dabrowski ***@***.***> wrote:
@ags799 <https://github.com/ags799> any timeline for this change to be
released? Not rushing things - just want to use this in a monorepo!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1748 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAWSCDPSPHXSTW277FNRT6TS6QIMBANCNFSM4W4M2QQA>
.
|
@ags799 amazing, thanks for an update! |
@thefill FYI the power outages in Texas have affected several of our engineers. The release could be delayed for another week. |
oh my, I have heard it's harsh there -_- no worries & thanks for letting me know. |
I think we need to revert this PR, unfortunately. It's causing issues for the @thefill If you could work on a fix, I can take a look at it. |
oh snap, sure will have a look ;-) |
Had a look at the cloudflare-docs@master and on the surface looks like a very simple setup - with nested package.json files, which should not cause problems. But obv the actions themselves have few more steps so I sure I'm missing things. Any chance you can point me to the build that is failing (you have quite a few failures in actions across the last few days - not sure all relate to the issue). |
ok, I see where the problem is - all clear. We need to make it a bit more explicit in detecting its node_modules by correlating it with the location of the closest package.json. This should follow the principle of most node projects as by design node_module should be located on the same level as package.json |
So the logic will go as follows:
That's just a quick draft - I'm sure this will change a bit when having code in front of my face. |
Then we lose the "monorepo" support, right? It's common to have a |
Ah, you mean orphaned package.json for e.g. release purposes? Uhh yeah, that's a good point. It all comes back to the question - should wrangler CLI be capable of handling all possible monorepo configs? It's an important one as I have seen in the past mono repo where you have node_modules on different levels - e.g. root provides tools, below one provides specific dependencies. Obv node resolves this but this CLI also have the job of installing wranglerjs module so where in that case it should do this? This begs for the installation of wranglerjs not during the execution of the "wrangler build" but rather during CLI installation e.g. during "npm i @cloudflare/wrangler -g" The flow could be as follows:
This would resolve many potential monorepo problems like dir structure or tooling type (yarn / npm / pnpm). |
I think #1677/custom builds will support the monorepo use case, since it doesn't require If you agree, I think we should revert this and release |
yep, I think that's the safest way going forward - trying to guess what different projects needs is pointless - we will always find an edge case. |
Revert #1748, update changelog-generator package.json, and release 1.15.0
Improvement of the detection of node_modules dir - adds bottom-up traversing to find it in parent dirs.
This should resolve some issues experienced with monorepos (e.g. with nx).
Example of an issue this can fix: #820 (comment)
To resolve most of the monorepo-related issues, we would need to refactor src/wranglerjs/mod.rs a bit more to establish the common root of node project (package.json and node_module location) and share it across a few other functions - still, that's a bit more work. I can do this some other time if you are keen on that.