# https://taskfile.dev version: "3" tasks: schemas: sources: [ 'schemas-yaml/*' ] generates: [ 'schemas-json/*' ] cmds: - fd -e yml -p ./schemas-yaml -x task schema SCHEMA='{}' schema: vars: TRANSFORM: sh: | echo {{.SCHEMA}} | \ perl -lnE's/yml$/pl/; s/^/.\//; say if -f $_' DEST: sh: echo {{.SCHEMA}} | perl -pe's/ya?ml/json/g' cmds: - transerialize {{.SCHEMA}} {{.TRANSFORM}} {{.DEST}} validate: deps: [ schemas ] silent: true cmds: - | ajv validate \ --all-errors \ --errors=json \ --verbose \ --data \ -c ajv-keywords \ -c ./src/sumOf.cjs \ -r schemas-json/classes.json \ -s schemas-json/character.json \ -d {{.CLI_ARGS}} test: deps: [ schemas ] cmds: - vitest run