farmOS / field-kit

A modular, offline-first companion app to farmOS.
https://farmOS.org
GNU General Public License v3.0
59 stars 38 forks source link

Scaffolding npm script: `create-field-module` #525

Closed jgaehring closed 10 months ago

jgaehring commented 10 months ago

This took a lot of trial and error to make sure all the field-scripts would work from both the monorepo environment as well as for standalone field modules via npm-init (aka, npm create). It also took some careful consideration of how exactly to structure the dependency graph, what to publish as their own packages, what utilities to include where, etc.

In the end, however, I really like the way the pieces all fell into place, with a total of 4 packages now published on the npm registry under the @farmos.org scope:

There is a README with full instructions, but the beauty of this can be tried out with just a few simple commands:

npm create @farmos.org/field-module field-module-egg-counter
cd field-module-egg-counter
npm install
npm start

And with that, you're off and running with a full dev environment, no other requirements but Node.js. I'm hoping to record a little demo some time before the next monthly call.

Resolves #422.

netlify[bot] commented 10 months ago

Deploy Preview for happy-dubinsky-808218 ready!

Name Link
Latest commit 6365afd2c52ed17802f21203ef81f016bf845c39
Latest deploy log https://app.netlify.com/sites/happy-dubinsky-808218/deploys/64f15ffb9fdf990008d3e78b
Deploy Preview https://deploy-preview-525--happy-dubinsky-808218.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.