You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the arrival of v0.2.0 it becomes easier (recommended) to separate application ontologies into their own npm package which exposes (if it should be reused in other packages) their auto-generated client. It is also custom behavior that these rlay-ontology packages expose their own classes which provide higher-level interfaces to their ontology. Example rlay-ontology package here: https://github.com/MichaelHirn/rlay-ontology-airtable
However, to consume these rlay-ontology packages i.e. require them in rlay-ontology packages and applications and use their ontology and high-level interfaces, is non trivial and requires manually changing the auto-generated client of the application.
To prevent that, we need to change two things:
integrating the schema of rlay-ontology packages
integrating the higher-level interfaces of rlay-ontology packages
Integrating the schema of rlay-ontology packages
The proposed solution is to update rlay-seed to produce an index of entityKey => entityPayload instead of entityKey => entityCID as it is currently implemented; an update of rlay-generate to only require the output of rlay-seed (and no path to any ontology file) or even work on the input of rlay-seed. Then rlay-ontology packages have to expose their src/ontology.js file which module.exports a rlay-seed JSON object. In the application that ontology JSON object can then be required and dropped into the imports attribute of its own rlay-seed JSON object. rlay-seed needs to accept payloads instead of only cids for its imports attribute.
If you want your rlay-ontology package to be required by other packages, you export the output of rlay-seed (aka. the ontology file's rlay-seed JSON object), otherwise don't.
Integrating the higher-level interfaces of rlay-ontology packages
A bit more unclear but orientate ourselves on plugin systems like those from babel, eslint, etc.
With the arrival of v0.2.0 it becomes easier (recommended) to separate application ontologies into their own npm package which exposes (if it should be reused in other packages) their auto-generated client. It is also custom behavior that these rlay-ontology packages expose their own classes which provide higher-level interfaces to their ontology. Example
rlay-ontology
package here: https://github.com/MichaelHirn/rlay-ontology-airtableHowever, to consume these rlay-ontology packages i.e.
require
them in rlay-ontology packages and applications and use their ontology and high-level interfaces, is non trivial and requires manually changing the auto-generated client of the application.To prevent that, we need to change two things:
Integrating the schema of rlay-ontology packages
The proposed solution is to update
rlay-seed
to produce an index ofentityKey => entityPayload
instead ofentityKey => entityCID
as it is currently implemented; an update ofrlay-generate
to only require the output ofrlay-seed
(and no path to any ontology file) or even work on the input ofrlay-seed
. Then rlay-ontology packages have to expose theirsrc/ontology.js
file whichmodule.exports
arlay-seed
JSON object. In the application that ontology JSON object can then berequired
and dropped into theimports
attribute of its ownrlay-seed
JSON object.rlay-seed
needs to accept payloads instead of only cids for itsimports
attribute.If you want your
rlay-ontology
package to be required by other packages, you export the output ofrlay-seed
(aka. the ontology file'srlay-seed
JSON object), otherwise don't.Integrating the higher-level interfaces of rlay-ontology packages
A bit more unclear but orientate ourselves on plugin systems like those from babel, eslint, etc.
cc @hobofan
The text was updated successfully, but these errors were encountered: