[WIP] Remove foreman vendor
Depends on https://github.com/theforeman/foreman/pull/10345 https://github.com/theforeman/foreman/pull/10239
"Fixes #37904 - move css from vendor to foreman " Does not bread plugins, but this pr does:
Some plugins have "peerDependencies": "@theforeman/vendor" or assume theforeman/vendor will be available from core, this PR removed theforeman/vendor so it will not be available anymore, and their webpack build will fail with:
ERROR in ./components/AnsibleRolesSwitcher/AnsibleRolesSwitcher.scss (../../foreman/node_modules/css-loader/dist/cjs.js!../../foreman/node_modules/sass-loader/dist/cjs.js!./components/AnsibleRolesSwitcher/AnsibleRolesSwitcher.scss)
webpack.1 | Module build failed (from ../../foreman/node_modules/sass-loader/dist/cjs.js):
webpack.1 | Can't find stylesheet to import.
webpack.1 | ╷
webpack.1 | 1 │ @import '~@theforeman/vendor/scss/variables';
webpack.1 | │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
and will have this console error:
Uncaught (in promise) Error: Module build failed (from ../../foreman/node_modules/sass-loader/dist/cjs.js):
Can't find stylesheet to import.
╷
1 │ @import '~@theforeman/vendor/scss/variables';
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
../foreman_ansible/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcher.scss 1:9 root stylesheet
In this PR we had to update to npm 8 to get the "overrides" attribute in package.json - "Overrides provide a way to replace a package in your dependency tree with another version, or another package entirely. ". Which we need to pin victory packages that are used in pf4 charts package. before I think because of some vendor magic pf4 used our install victory, and not the one from the pf4 node_modules, but since I'm simplifying things and moving it all to foreman it doesnt work anymore so we need to completely override victory versions, and not just installing an old one.
@theforeman/packaging are we ok to update to NPM 8+?
@theforeman/packaging are we ok to update to NPM 8+?
@theforeman/packaging are we ok to update to NPM 8+?
When we merge https://github.com/theforeman/foreman/pull/10406 it should be something we get for free.
dnd still not working in host edit with vm ware - need to fix edit: https://projects.theforeman.org/issues/37882
@MariaAga now we can properly rebase this PR
rebased but didnt finish testing it
seperate javascript and react app imports is needed to fix the bug where imports are happening in the wrong order, without it, for some files for example
import a from 'a';
console.log(a)
will log undefined even if a is defined
Thanks, squashed, updated the procfile, and removed the npm8 installation
Packaging status:
- [X] first set of packages https://github.com/theforeman/foreman-packaging/pull/12145
- [x] second set of packages https://github.com/theforeman/foreman-packaging/pull/12174
- [x] Reqs https://github.com/theforeman/foreman-packaging/pull/12157
@MariaAga seems unrelated, but can you make sure it's OK: https://github.com/theforeman/foreman/actions/runs/16148221131/job/45572685027?pr=10342#step:16:728
@ShimShtein it is unrelated (org tests just randomly fail)
/packit build
ModuleNotFoundError: Module not found: Error: Can't resolve 'react-bootstrap' in '/usr/lib/node_modules/react-ellipsis-with-tooltip/dist'
Mhh, react-bootstrap is a peerDependency of react-ellipsis-with-tooltip, and our packaging doesn't pull those in.
@evgeni
Mhh, react-bootstrap is a peerDependency of react-ellipsis-with-tooltip, and our packaging doesn't pull those in.
is this a hint for me to add it?
not yet :)
https://github.com/theforeman/foreman/pull/10601 - let's see if adding react-bootstrap helps.
Edit:
[webpack-cli] ModuleNotFoundError: Module not found: Error: Can't resolve 'react-router' in '/usr/lib/node_modules/connected-react-router/esm'
Well, at least it's a different error now? :crying_cat_face:
@MariaAga okay, now that #10601 has built on packit: please pull in the react-router and react-bootstrap changes I did into package.json.
I have no idea if it also needs to be added to webpack.js -- seems to work without as long as the peer dependency is satisfied.
Packaging update:
- [x] https://github.com/theforeman/foreman-packaging/pull/12221
no runtime error for not adding react-router and react-bootstrap to webpack vendor list
/packit build
green packit! :green_apple:
Ubuntu 22.04: TODO (OS repo has NodeJS 12 so we use nodesource; 14 at the moment)
NodeJS 18.20.6 with NPM 10.8.2