I've talked about making it possible to use the farmOS.js client w/o the model (and vice versa), and that is indeed possible even today, like so:
import client from 'farmos/src/client';
It's a little cumbersome, however, and moreover it's generally considered poor practice to couple the public API surface to the internal directory structure of a library in this way.
Instead, we can export the client and model from src/index.js,
export { default as model } from './model/index.js';
export { default as client } from './client/index.js';
which can be imported by consumers as:
import { client } from 'farmos';
all while the main farmOS function which combines the two remains the default export.
This can all be achieved rather easily, but I think its worth taking a little more time to weigh which functions/modules we want to expose in this way.
I've talked about making it possible to use the farmOS.js client w/o the model (and vice versa), and that is indeed possible even today, like so:
It's a little cumbersome, however, and moreover it's generally considered poor practice to couple the public API surface to the internal directory structure of a library in this way.
Instead, we can export the client and model from
src/index.js
,which can be imported by consumers as:
all while the main
farmOS
function which combines the two remains the default export.This can all be achieved rather easily, but I think its worth taking a little more time to weigh which functions/modules we want to expose in this way.