npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@viamrobotics/remote-control

v2.14.4

Published

Viam provides an open source remote control (RC) page as part of the RDK that allows for troubleshooting and control of components. RC is hosted locally on each robot as well as on Viam cloud.

Downloads

1,062

Readme

RDK Remote Control

Viam provides an open source remote control (RC) page as part of the RDK that allows for troubleshooting and control of components. RC is hosted locally on each robot as well as on Viam cloud.

Running Locally

Development Mode

To start the client development environment, navigate to web/frontend. After npm install, Run npm run build to copy PRIME static assets to the web/frontend/runtime-shared/static folder, including font icons. Finally run npm start.

In a new terminal tab, go run with the environmental variable ENV=development (e.g. ENV=development go run web/cmd/server/main.go -debug -config etc/configs/fake.json).

Visit localhost:8080 to view the app, not localhost:5173. The latter is a hot module replacement server that rebuilds frontend asset changes.

Production Mode

Remote Control can be run locally in production mode, which is useful in some situations, such as testing changes to the build or AppImage packaging process.

First run make build-web which will produce static assets into the web/frontend/runtime-shared/static folder. Then start the server with go run without the ENV variable (e.g. go run web/cmd/server/main.go -debug -config etc/configs/fake.json).

Note: If the build is not completed or fails, you should receive an warning message stating that files are missing. The RC page will not load in the case where a frontend build is not done.

For example: 2023-03-02T17:18:20.492-0500 WARN robot_server web/web.go:662 Couldn't find any static files when running RDK. Make sure to run 'make build-web'.

AppImage

Remote Control is automatically included into the Viam AppImage using go:embed. The AppImage will automatically place all files in the runtime-shared folder based on App FileSystemCode.

The production files are generated by the Github Actions workflow after changes are merged. The workflow runs make build:web before generating the AppImage, including the files without them being commited to the Github Repository.

NPM Package

Remote Control components are exported to the @viamrobotics/remote-control NPM package to allow for reuse. For each frontend change, it is important to increment the version of the NPM package. Otherwise, changes will be made only to the AppImage and not to the NPM package. The publishing process does not update existing NPM versions and requires a higher version to publish changes. To update the version:

  1. Change the package.json file and increase the version field by 1.
  2. Include the version bump in your PR with the corresponding frontend changes.
  3. Upon merging, your changes will be published to NPM using the Github Actions worklow.

The file paths listed in the files field of package.json determines what is published to NPM, and may need to be updated in the future to change what is/isn't published into the repository.

Using the NPM Package

If you intend to use the Remote Control in you own application, consider whether or not your application will be creating its own connection to the robot using the Viam TypeScript SDK. If so, be aware the Remote Control also creates and manages its own SDK Client. If you intend to use the Remote Control and make your own SDK Client to make API calls, you will want to make sure you disconnect from your Client after each API call so you do not maintain multiple long-running connections to the robot.

The NPM package does not include styles. Instead, we require tailwindcss as a peer dependency, and you must include the NPM package artifacts in your tailwind config:

// tailwind.config.js
module.exports = {
  content: [
    './components/**/*.{html,js}',
    './pages/**/*.{html,js}',
    './node_modules/@viamrobotics/remote-control/**/*.js',
  ],
  // ...
};