Open zgaduj opened 2 years ago
Hi,
This is very strange, and I have no explanation for it. The npm packages are immutable, so there is no way a new release could have altered the contents of v1.4.2.
If you can, try running yarn why @vendure/admin-ui-plugin
and see if there are somehow multiple versions being installed.
After deleted node_modules, yarn.lock, admin-ui folder and yarn install
:
root@2c4e8fdffbcd:/home/node/app# yarn why @vendure/admin-ui-plugin
yarn why v1.22.17
[1/4] Why do we have the module "@vendure/admin-ui-plugin"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "@vendure/admin-ui-plugin@1.3.4"
info Has been hoisted to "@vendure/admin-ui-plugin"
info This module exists because it's specified in "dependencies".
info Disk size without dependencies: "32.11MB"
info Disk size with unique dependencies: "32.41MB"
info Disk size with transitive dependencies: "32.53MB"
info Number of shared dependencies: 4
Done in 0.77s.
Am I understanding this correctly:
For testing In my package.json is 1.3.4
but this is not important. Admin always have latest version after building docker image.
I found solution.
Function compileUiExtensions
from @vendure/ui-devkit/compiler
taking
@vendure/admin-ui
from https://github.com/vendure-ecommerce/vendure/blob/4a11666463ae36109e741d64efff08c2cf7bb666/packages/ui-devkit/src/compiler/scaffold.ts#L186
In my package.json not exists @vendure/admin-ui
in dependencies but in package.json of @vendure/ui-devkit
exists with "@vendure/admin-ui": "^1.3.4",
So dash installing version to <2.0.0 ? That's why I have this version 1.4.3
.
I think you shouldn't use ^
in internal dependencies of project.
Ah I see. Yes that makes sense, thanks for your investigation.
Related: https://github.com/lerna/lerna/issues/2040
Lerna (which we use for managing versions of all monorepo packages) will automatically set the semver range for internal dependencies to be ^
, so even if I manually change them to ~
, the next time I use lerna to update versions (as in publishing a new release), they will all get reset to use ^
again.
So this is a bit tricky to solve. I'm thinking it might make sense to eventually move over to something like Nx, as Lerna does not seem to be actively maintained anymore.
Describe the bug When new version of Vendure was released and my CI/CD creating new image I see every time newest version. My package.json have versions:
And yarn.lock:
So why in Admin UI I have 1.4.3? Somebody can explain this?
Now in Production is mismatch versions.. Very good when I have e.g.
1.3.4
version and admin1.4.3
:D Everywhere Errors like a fireworks