Closed RamiCMT closed 2 months ago
@EzraBrooks could you have a look at this? As you contributed most changes, except from dependabot, https://github.com/RobotWebTools/roslibjs/compare/253ae642782bddb3f942b19dc6462007d9f249c7...cf1f5ada69e9f3f8e22887ffb000b0ca2dfc2277
Sure. I have been using it with React via NPM but have been publishing a pre-release version of the package to my own registry, not referencing it directly via Git. It should be possible to use some lifecycle hooks to make it work properly with this workflow.
One issue here appears to be that the publish
lifecycle hook is being called (at least when I install with PNPM, which is what I'm using on my current project), and publish
runs the tests in this repo.
Looking at the NPM documentation, this first issue should be solved by moving testing into prepublishOnly
, which is not invoked for local installations like prepublish
and publish
are.
https://github.com/RobotWebTools/roslibjs/blob/cf1f5ada69e9f3f8e22887ffb000b0ca2dfc2277/package.json#L52
Description React: NPM doesn't package roslib properly when using "npm install" after specifying latest 'develop' commit in package.json
Steps To Reproduce
I'm developing a web interface using roslibjs within React. I decided to use the "develop" branch for ROS2 support, as the "ros2" branch hasn't been updated in years. To do this, I specified the commit SHA in the package.json file, using the following syntax and command:
"roslib": "github:RobotWebTools/roslibjs#253ae642782bddb3f942b19dc6462007d9f249c7", $ npm install
I had been using an older commit (the one shown above) as the most recent "develop" commit doesn't seem to package roslib properly with NPM; the pictures below of the VS Code file explorer should highlight the issue. Due to this issue, I was unable to import roslib functionality and had to revert to the older commit.
That older commit had been working fine, but there was an issue with how the lib was using "Websocket" in the node_modules/roslib/src/core/Ros.js file. If I attempted to reconnect to the rosbridge using the same "Ros" object, the "WebSocket.CLOSED" used in the comparison on line 76 causes the following issue: file:///home/ramiqamhieh/Pictures/Screenshots/Screenshot%20from%202024-04-16%2015-25-27.png This WebSocket issue is irrelevant; this is simply the reason I decided to try to switch to the most recent commit.
Expected Behavior From 'develop' commit I had been using (253ae642782bddb3f942b19dc6462007d9f249c7) /node_modules/roslib![image](https://github.com/RobotWebTools/roslibjs/assets/139265947/2525aa1b-ff55-41f0-9b13-343b3d250956)
Actual Behavior The /src directory is missing From latest 'develop' commit (cf1f5ada69e9f3f8e22887ffb000b0ca2dfc2277) /node_modules/roslib![image](https://github.com/RobotWebTools/roslibjs/assets/139265947/163f50f1-a152-44ac-824d-5ba6dc7c1527)
Full package.json file: