Using the ppxlib workflow described in https://tarides.com/blog/2019-05-09-an-introduction-to-ocaml-ppx-ecosystem. In particular:
lib/deriver.ml with a Located functor consuming an Ast_builder.S;
deriver/ppx_<project>.ml that registers {sig,str}_type_decl_generator functions taken from the library using first-class modules;
test/deriver/{errors,passing}/*.{ml,expected} files with corresponding gen_dune_rules.ml script and a dune promote workflow.
Using the
ppxlibworkflow described in https://tarides.com/blog/2019-05-09-an-introduction-to-ocaml-ppx-ecosystem. In particular:lib/deriver.mlwith aLocatedfunctor consuming anAst_builder.S;deriver/ppx_<project>.mlthat registers{sig,str}_type_decl_generatorfunctions taken from the library using first-class modules;test/deriver/{errors,passing}/*.{ml,expected}files with correspondinggen_dune_rules.mlscript and adune promoteworkflow.