grafana/pkg/codegen
Marcus Andersson 7f92f1df00
Schema: Refactor plugin code generation (#58901)
* wip

* wip

* almost there..

* wip - change so it can run.

* treelist is working.

* support CODEGEN_VERIFY env variable

* use log.fatal

* comment out old PluginTreeList code generation

* cleanup

* rename corelist package files

* fix makefile

* move pkg/codegen/pluggen.go to pkg/plugins/codegen

* copy and refactor files to pkg/plugins/codegen

* use pkg/plugins/codegen instead of pkg/codegen for core plugins code gen

* remove unneeded files

* remove unused code to resolve linting errors

* adapters first hack

* added flattener

* add back ignore build tags to go generate file

* cleaned up the code a bit.

* seems to work, needs to do some refactoring of the GoTypesJenns and TSTypesJenny.

* one more step, going to get upstream changes in this branch.

* working but need to run import tmpl in jenny_schemapath to have the proper imports.

* added header to generated files.

* added missing jenny.

* preventing plugins with multiple decls/schemas to insert multiple lines in corelist.

* fixed so we use Slot type from kindsys to detect if its group.

* adding a go jenny that only runs if the plugin has a backend.

* added version object to generated ts.

* generating the ts types with the same output as prior to this refactoring.

* removed code that is replaced by the jenny pattern.

* removed the go code that isn't used anymore.

* removed some more unused code and renamed pluggen to util_ts

* fixed linting issue.

* removed unused vars.

* use a jenny list postprocessor for header injection

* moved decl and decl_parser to pfs.

* removed the pre-pended header in the gotypes jenny since it is done in the postprocess.

* moved decl to pfs.

* removed unused template.

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-12-02 08:22:28 +01:00
..
tmpl codegen: Refactor core jennies for reusability, add version-picking metajennies (#58995) 2022-11-22 15:00:29 +01:00
astmanip_test.go Reconcile coremodels, entities, objects under new kind framework (#56492) 2022-11-10 12:36:40 -08:00
coremodel.go plugindef: Move pluginmeta out of coremodels as standalone thema lineage (#56765) 2022-11-15 14:48:31 +01:00
diffwrite.go schema: Generate Go and Typescript from Thema coremodels (#49193) 2022-05-27 03:21:37 +02:00
generators.go codegen: Refactor core jennies for reusability, add version-picking metajennies (#58995) 2022-11-22 15:00:29 +01:00
jenny_basecorereg.go codejen: Update to latest codejen (#58866) 2022-11-16 15:08:01 -05:00
jenny_corestructkind.go Reconcile coremodels, entities, objects under new kind framework (#56492) 2022-11-10 12:36:40 -08:00
jenny_eachmajor.go codegen: Refactor core jennies for reusability, add version-picking metajennies (#58995) 2022-11-22 15:00:29 +01:00
jenny_gotypes.go codegen: Refactor core jennies for reusability, add version-picking metajennies (#58995) 2022-11-22 15:00:29 +01:00
jenny_rawkind.go Reconcile coremodels, entities, objects under new kind framework (#56492) 2022-11-10 12:36:40 -08:00
jenny_tstypes.go codegen: Refactor core jennies for reusability, add version-picking metajennies (#58995) 2022-11-22 15:00:29 +01:00
jenny_tsveneerindex.go Perfomance: add preallocation for some slices (#59263) 2022-11-28 13:10:24 +01:00
latest_jenny.go codegen: Refactor core jennies for reusability, add version-picking metajennies (#58995) 2022-11-22 15:00:29 +01:00
tmpl.go Schema: Refactor plugin code generation (#58901) 2022-12-02 08:22:28 +01:00
util_go.go plugindef: Move pluginmeta out of coremodels as standalone thema lineage (#56765) 2022-11-15 14:48:31 +01:00