Farmbot-js somewhat MacOS-centric

Preferring to play with JavaScript on Ubuntu ( aarch64 / arm64 on Raspberry Pi ) I’ve learned that some adjustments are needed to have the whole thing work on this platform.

Using NPM package farmbot version 10.2.1 shows

  • fsevents is a Mac-specific package
  • ts-jest needs a specific ( earlier ) version of jest

Any thoughts on how I should address these ? ( maybe I can skip the unit testing bit :wink: _)

picture this =>

@jsimmonds Does FBJS not run on your machine? I find this surprising because I’ve actually never used FBJS on a mac machine. I have used it on an Xubuntu 18 machine for Node and Frontend work almost exclusively.

Also, the FBJS test suite has quite a bit of dust on it- I would not worry about it too much. It’s one of those libraries that rarely changes and rarely is the cause of production problems. As a result, I’ve been admittedly negligent in maintaining those parts of the lib.

1 Like

Ah, sorry for that impression; yes, all the code I need in FBJS is working nicely, thanks :slight_smile:

Just one little question about FBJS while I’m here, though …

  • What’s the function to use to create a Point ?

FarmBot JS only deals with commands rather than resources. You would need to use an HTTP client for resource management.

I thought about adding resource management in the past but never got around to it (and realisticly don’t see myself having time in the next few months). In the interim, I would recomend:

  • Using Axios as an HTTP client
  • Viewing our list of auto generated API responses for the sake of example (CTRL+F may be useful). It’s important to note that the examples are always correct because they are created using the test suite every time we run it. If you get errors, it may be an indication of a settings problem on the client side.

Very useful information ! Thanks @RickCarlino