Rather than shipping the schemas and rendering the library at runtime, this PR renders a static version of Grafonnet and ships the code as such. The main advantage is that we gain language server support (fixes #90), which should improve developer experience dramatically.
In addition this change also reduces the number of dependencies, it becomes faster and easier to debug/inspect.
For review, the chore: generate vX commits are the generated stuff, that is the biggest chunk of the diff. Most changes happen in the first commit. Here's a summary of the relevant changes besides those in gen/:
# Update or new to support generator
Makefile | 48 +---
scripts/generate.sh | 47 ++++
scripts/generate_latest.sh | 48 ++++
# Intentional copy change, also visible on the gen/
docs/API/util.md | 24 +-
# Fixing the unit/smoke tests
test/util_test.jsonnet | 3 +-
examples/redMethod/lib/redDashboard/panels.libsonnet | 13 +-
# Replaced by generator/
generate.jsonnet | 90 --------
versions.jsonnet | 6 -
grafonnet-base/main.libsonnet | 357 -----------------------------
grafonnet-base/helpers.libsonnet | 173 --------------
docs.libsonnet => generator/latest_docs.libsonnet | 11 +-
{grafonnet-base => generator}/jsonnetfile.json | 0
# The new generator, new code, some bits and pieces come from grafonnet-base/
# main is the entry point
generator/main.libsonnet | 19 ++
# utils has most logic that was in grafonnet-base/main.libsonnet
generator/utils.libsonnet | 195 ++++++++++++++++
generator/core.libsonnet | 321 ++++++++++++++++++++++++++
generator/panel.libsonnet | 215 +++++++++++++++++
generator/query.libsonnet | 171 ++++++++++++++
generator/row.libsonnet | 52 +++++
generator/refactor.libsonnet | 58 +++++
generator/dependencies.libsonnet | 26 +++
generator/latest.libsonnet | 29 +++
# Mostly moved over to custom/, change too big to detect as moved file
grafonnet-base/veneer/annotation.libsonnet | 12 -
grafonnet-base/veneer/core.libsonnet | 336 ---------------------------
grafonnet-base/veneer/link.libsonnet | 81 -------
grafonnet-base/veneer/main.libsonnet | 6 -
grafonnet-base/veneer/panel.libsonnet | 227 ------------------
grafonnet-base/veneer/query.libsonnet | 90 --------
grafonnet-base/veneer/row.libsonnet | 12 -
grafonnet-base/veneer/variable.libsonnet | 463 -------------------------------------
# New home of the handwritten veneer
custom/dashboard.libsonnet | 44 ++++
custom/dashboard/annotation.libsonnet | 36 +++
custom/dashboard/link.libsonnet | 90 ++++++++
custom/dashboard/variable.libsonnet | 483 +++++++++++++++++++++++++++++++++++++++
custom/panel.libsonnet | 125 ++++++++++
custom/query/loki.libsonnet | 27 +++
custom/query/prometheus.libsonnet | 47 ++++
custom/query/tempo.libsonnet | 29 +++
custom/row.libsonnet | 11 +
{grafonnet-base => custom}/util/dashboard.libsonnet | 5 +-
{grafonnet-base => custom}/util/grid.libsonnet | 103 +--------
{grafonnet-base => custom}/util/main.libsonnet | 0
{grafonnet-base => custom}/util/panel.libsonnet | 6 +-
{grafonnet-base => custom}/util/string.libsonnet | 0
43 files changed, 2105 insertions(+), 2034 deletions(-)
Rather than shipping the schemas and rendering the library at runtime, this PR renders a static version of Grafonnet and ships the code as such. The main advantage is that we gain language server support (fixes #90), which should improve developer experience dramatically.
In addition this change also reduces the number of dependencies, it becomes faster and easier to debug/inspect.
For review, the
chore: generate vX
commits are the generated stuff, that is the biggest chunk of the diff. Most changes happen in the first commit. Here's a summary of the relevant changes besides those ingen/
: