11.DEFAULT_GOAL := all
22
3- JSONSCHEMA ?= jsonschema
3+ JSONSCHEMA ?= ./node_modules/@sourcemeta/ jsonschema/cli.js
44JQ ?= jq
55SHELLCHECK ?= shellcheck
66TAR ?= tar
@@ -15,30 +15,30 @@ NPM ?= npm
1515include generated.mk
1616
1717# TODO: Make `jsonschema fmt` automatically detect test files
18- all : common test
19- $(JSONSCHEMA ) fmt schemas meta
20- $(JSONSCHEMA ) fmt test --default-dialect " https://json-schema.org/draft/2020-12/schema"
18+ all : common test node_modules
19+ $(NODE ) $( JSONSCHEMA ) fmt schemas meta
20+ $(NODE ) $( JSONSCHEMA ) fmt test --default-dialect " https://json-schema.org/draft/2020-12/schema"
2121
2222.PHONY : common
23- common : $(GENERATED )
24- $(JSONSCHEMA ) metaschema schemas meta
25- $(JSONSCHEMA ) lint schemas meta
26- $(JSONSCHEMA ) validate meta/schemas-root.json schemas
27- $(JSONSCHEMA ) validate meta/schemas.json schemas
28- $(JSONSCHEMA ) validate meta/test.json test
23+ common : $(GENERATED ) node_modules
24+ $(NODE ) $( JSONSCHEMA ) metaschema schemas meta
25+ $(NODE ) $( JSONSCHEMA ) lint schemas meta
26+ $(NODE ) $( JSONSCHEMA ) validate meta/schemas-root.json schemas
27+ $(NODE ) $( JSONSCHEMA ) validate meta/schemas.json schemas
28+ $(NODE ) $( JSONSCHEMA ) validate meta/test.json test
2929 $(SHELLCHECK ) scripts/* .sh
3030 ./scripts/quality-schemas-tests-mirror.sh
3131 ./scripts/quality-templates-xbrl-utr-mirror.sh
3232
3333# TODO: Make `jsonschema fmt` automatically detect test files
3434.PHONY : lint
35- lint : common
36- $(JSONSCHEMA ) fmt schemas meta --check
37- $(JSONSCHEMA ) fmt test --check --default-dialect " https://json-schema.org/draft/2020-12/schema"
35+ lint : common node_modules
36+ $(NODE ) $( JSONSCHEMA ) fmt schemas meta --check
37+ $(NODE ) $( JSONSCHEMA ) fmt test --check --default-dialect " https://json-schema.org/draft/2020-12/schema"
3838
3939.PHONY : test
40- test :
41- $(JSONSCHEMA ) test ./test
40+ test : node_modules
41+ $(NODE ) $( JSONSCHEMA ) test ./test
4242 $(NODE ) npm/cjs.test.js
4343 $(NODE ) npm/esm.test.mjs
4444
5858 $(MKDIRP ) $@ /npm
5959 $(NPM ) version --no-git-tag-version --allow-same-version " $( VERSION) "
6060 $(NPM ) pack --pack-destination $@ /npm
61+
62+ node_modules : package.json package-lock.json
63+ $(NPM ) ci
0 commit comments