Update CLI implementation with modern tooling and conventions#1456
Update CLI implementation with modern tooling and conventions#1456relu91 wants to merge 30 commits intoeclipse-thingweb:masterfrom
Conversation
cli.ts log now enables by default error and warning messages.
As a result the responsibility of managing the initial configuration for logging has been moved outside the DefaultServient.
WARNING: Drops support for running remote scripts from the Default Servient Thing. This feature was rarely used and controversial due to security implications. Users wanting to run remote scripts can easily implement this feature in their own Servient by extending the CLI Servient.
now envs are treated as config parameters
|
There is a small problem in the CLI tests due to some file shared across different unit tests. I'll fix them asap. They should not require changes to the business logic of the new CLI. |
danielpeintner
left a comment
There was a problem hiding this comment.
Note: I did not fully check nor run it locally, but I would like to make some comments:
- THANK YOU for the effort. I think it is very helpful to get rid of VM2
- I am surprised that no file has been removed (can it be?)
- some more comments, see below
I like this :) I could not review the rest of the PR yet... |
I am fine with changing it. IF WE DO IT, we should publish first a node-wot version and increase the major version to make it clear it is a breaking change. |
Co-authored-by: danielpeintner <daniel.peintner@gmail.com>
Given that we already have two other breaking changes in this PR, it makes sense to target a major version increase anyway. If we can discuss this in the next committer meeting. |
With the new changes we are not using a vm anymore, so user can directly use node inspect options.
|
cleaned up a little bit of the code. |
|
@relu91 mentioned on Telegram that vm2 efforts revived Honestly, I don't know which path to go is best... in any case.. even if we would stick to vm2 we should take over some changes Cristiano did in this PR... |
|
As stated offline, I think we can leave vm2 for now. We can re-introduce it if we get real feedback from our users to have isolation between wot scripts and the current Node.js project. So far, the usage has been limited. |
|
@relu91 I think we can finally move on with this PR ... 🎉 |
|
@danielpeintner sadly, I had to re-generate package lock :/ Let me know if you are ok to merge it with these unrelated changes, or if I should try to rebase the whole history from main. That's probably why CI is failing due to coap? |
|
Either way is fine for me. We should just manage to get a clean CI run with the right dependencies (versions) |
I know that this PR will be long to review, but it has been sitting on my pc for a while, and it is time to push the changes. The primary goal was to get rid of the VM2 module, which is now deprecated and audited as a critical security risk. I used the opportunity to completely revise the implementation and make it:
In summary, this PR delivers a significant refactor and several quality-of-life improvements to the cli module, primarily focusing on simplifying configuration, execution, and improving code organization.
Key Changes and Improvements
WOT_SERVIENT_SERVIENT_CLIENTONLY->servient.clientOnly)Open Point for Discussion
Given the extensive changes and the focus on the primary user experience:
wot-servient, is potentially surprising for regular users as it differs from the package name. I propose renaming it tonode-wotto align with the project name and make it feel less surprising.