-
Notifications
You must be signed in to change notification settings - Fork 358
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
[WIP] update:ui - support node_modules locations outside of gem engine dirs #4435
Conversation
This almost works now, except:
So... with the two PRs this works except for the typescript bits:
EDIT: also, yarn modules-folder will still create |
this depends on a core PR (ManageIQ/manageiq#17818) to provide the right path to node_modules via AssetPath On our side, we just use the directories provided. (except for running webpack, using the dir even there, postcss config, and typescript)
Some comments on commits https://github.com/himdel/manageiq-ui-classic/compare/5cb108fd2c918a4897be82fc26255215f6c95530~...d7ce729c218e2c89f322abd6f46182f320527d4d lib/tasks/manageiq/ui_tasks.rake
|
Checked commits https://github.com/himdel/manageiq-ui-classic/compare/5cb108fd2c918a4897be82fc26255215f6c95530~...d7ce729c218e2c89f322abd6f46182f320527d4d with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Core PR ManageIQ/manageiq#17818 merged |
@@ -9,7 +9,7 @@ namespace :update do | |||
asset_engines.each do |engine| | |||
Dir.chdir engine.path do | |||
next unless File.file? 'package.json' | |||
system("yarn") || abort("\n== yarn failed in #{engine.path} ==") | |||
system("yarn --modules-folder='#{engine.node_modules}'") || abort("\n== yarn failed in #{engine.path} (output: #{engine.node_modules}) ==") |
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.
Should this be EDIT: nvm, I didn't see that this was a yarn call for each pluginengine.node_root
?
This pull request is not mergeable. Please rebase and repush. |
Possible alternative: #5196 Yarn provides a plug&play mode where The downside from the view of the purpose of this PR is that currently it still tries to create The advantage is that according to https://yarnpkg.com/en/docs/pnp/getting-started, typescript is handled (though by a different loader than we're using). |
Small progress - dropping typescript in #5707 |
tink may also become a viable alternative (a npm project, no EDIT: there's also pnpm, but that does create |
@himdel I see you are making progress the last couple days, but it's a little hard to follow the various PRs and repos. Can you give a tl;dr on what you've found? |
@Fryguy sure... We're special because of the way we do UI plugins - the plugins can have their own package.json dependencies, while ui-classic does not depend on any of the plugins via npm, causing us to have multiple dependency trees with no single root. That's the only problem stopping us from using yarn plug & play now (it works if I disable the plugins). So, the idea is to, either:
|
@himdel I'm interested in the yarn namespaces idea. I'd really like to avoid |
@Fryguy Agreed it's a good feature to support, I'll see how it goes :). |
yarn 3 helps a lot more with this, particularly when using the global cache. When we get to Plug'n'Play it should go away. Closing for now |
this depends on a core PR (ManageIQ/manageiq#17818) to provide the right path to node_modules via AssetPath
On our side, we just use the directories provided.
(except for running webpack, using the dir even there, postcss config, and typescript)