From 158d82c0a57a3f1ce00eafabe9589a4c43b22749 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Wed, 19 Nov 2025 15:23:46 -0400 Subject: [PATCH] Move version to `jsonschema.json` Signed-off-by: Juan Cruz Viotti --- Makefile | 5 ++--- VERSION | 1 - generated.mk | 1 - jsonschema.json | 3 ++- 4 files changed, 4 insertions(+), 6 deletions(-) delete mode 100644 VERSION diff --git a/Makefile b/Makefile index 0bad2233..6cce3dd7 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ .DEFAULT_GOAL := all JSONSCHEMA ?= jsonschema +JQ ?= jq SHELLCHECK ?= shellcheck TAR ?= tar ZIP ?= zip @@ -13,9 +14,6 @@ RMRF ?= rm -rf SCHEMAS = $(shell find schemas/ -type f -name '*.json') TESTS = $(shell find test/ -type f -name '*.json') -# TODO: Add a version property to `jsonschema.json` -VERSION = $(shell tr -d '\n\r' < VERSION) - include generated.mk # TODO: Make `jsonschema fmt` automatically detect test files @@ -46,6 +44,7 @@ test: # TODO: Add a `jsonschema pkg` command instead .PHONY: dist +VERSION = $(shell $(JQ) --raw-output '.["x-version"]' jsonschema.json) dist: $(RMRF) $@ $(MKDIRP) $@ diff --git a/VERSION b/VERSION deleted file mode 100644 index 0ea3a944..00000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.2.0 diff --git a/generated.mk b/generated.mk index 61d8cedb..f0310ea6 100644 --- a/generated.mk +++ b/generated.mk @@ -1,5 +1,4 @@ PYTHON ?= python3 -JQ ?= jq define MAKE_SCHEMA schemas/$1.json: templates/schemas/$1.jq $2.json diff --git a/jsonschema.json b/jsonschema.json index 3a42024c..30dd4772 100644 --- a/jsonschema.json +++ b/jsonschema.json @@ -3,5 +3,6 @@ "description": "A growing collection of hand-crafted high-quality schemas by Sourcemeta", "email": "hello@sourcemeta.com", "github": "sourcemeta/std", - "path": "./schemas" + "path": "./schemas", + "x-version": "0.2.0" }