-
Notifications
You must be signed in to change notification settings - Fork 81
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
chore: add package version consistency check #515
chore: add package version consistency check #515
Conversation
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.
First of all thank you for your contribution, reducing the total installation size is great 🎉 . I have a couple of concerns that need to be addressed:
- the minimum node required version for node-wot is 12, but all
node
types are updated to 16.x. It should really be 12.x - I am not sure that adding all the dev dependencies indiscriminately to the root package module is providing value. Some shared dependencies may be indeed added there, like tsc or ts-node, but I am seeing also
vm2
,coap
,mqtt
, why are there?
By the way, I had the impression that npm workspaces should have already handled packages with the same version and install them once in the root module. isn't that so? why do we need to add "everything" as dev dependency in the root package.json ?
Note: I think the idea of having all dependencies at the root level is the following: Doing so prohibits downloading the same dependency in subfolders. Anyhow, I guess we need to check whether our change from |
So I did some local tests with a toy project. Project structure:
If I install the same typescript version on the two workspaces I get the following:
If package b has a different typescript version, I get the following:
In both cases, the root package JSON was not touched. My conclusion is that we need a version alignment for every dev tool inside What I found online is that it might be a good practice to include |
Some more comments (summary):
|
You are correct ! there is no need to duplicate modules in the main package.json, just having version consistency is enough. the script is now called |
I have also added a dedicate step in the build system that enforces version consistency verification.
|
4e5271d
to
364e488
Compare
It doesn't harm to use At the end, node12 is used in the CI/CD. this is what counts. Some users might want to run node-wot with node16. |
@erossignon I see Eclipse / ECA issue? You have to associate your account with it, see also https://github.com/apps/eclipse-eca-validation |
I am afraid the issue is caused by 809ac9b which was the result of a suggestion by me. @erossignon Maybe you can squash the commit with a CI related commit from before to avoid the issue? |
e8836f6
to
90ef6e9
Compare
Thank ! I squashed it. |
90ef6e9
to
882a911
Compare
def4ddc
to
64d6108
Compare
Thanks @erossignon the latest changes
|
- align packages version and add tooling package at root
64d6108
to
ab02208
Compare
|
npm run format has been run |
ab02208
to
cda2f14
Compare
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.
Looks great now! I have still a concern about the node version, to me is quite annoying to build an entirely new feature (maybe using a new nodejs API) and realizing only in the CI that I can't use it. Build time checks are important and make development faster. However, this is my workflow style and if others are ok to bump up node type I am fine either way 👍🏻
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.
LGTM
IF the node version 16 causes issues we can revert this change
Hi, I would like to propose this utility that will help to detect misalignment of packages version.
This tool scans the subpackage folder and analyzes their dependencies/devDependencies.
It searches for packages that appear in multiple modules but have different versions and gives you hints to fix the package.json files.
Finally, it gives you a list of all packages used by all modules of the mono repo that we can add to the devDependencies section of the main package.json.
By doing this we allow all shared modules to be installed once at the top level.
By using it, we can reduce the installed size from 2.1Gb to 500mb