-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
49 lines (38 loc) · 1.64 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
default: all
NPX = npx
INVOICE_SCHEMA_DEPENDENCIES = \
peppol-bis-invoice-3/structure/syntax/ubl-invoice.xml \
peppol-bis-invoice-3/structure/codelist/*.xml
all: \
src/schema/invoice.schema.json \
src/invoice/invoice.interface.ts \
src/invoice/invoice.schema.ts \
src/schema/mapping.schema.json \
src/mapping/mapping.interface.ts \
src/mapping/mapping.schema.ts \
documentation/BusinessTerms.md
src/schema/invoice.schema.json: scripts/parse-ubl-structure.mts $(INVOICE_SCHEMA_DEPENDENCIES)
$(NPX) tsx $< >$@ || rm -f $@
$(NPX) ajv compile --spec=draft2019 -s $@ || rm -f $@
src/invoice/invoice.interface.ts: scripts/json-schema-to-interface.mts src/schema/invoice.schema.json
$(NPX) tsx $< src/schema/invoice.schema.json $@
$(NPX) eslint $@ --fix
src/invoice/invoice.schema.ts: scripts/json-schema-to-typescript.mts src/schema/invoice.schema.json
$(NPX) tsx $< invoice
$(NPX) eslint $@ --fix
$(NPX) prettier --write $@
src/schema/mapping.schema.json: scripts/transform-ubl-mapping.mts src/schema/invoice.schema.json
$(NPX) tsx $< src/schema/invoice.schema.json $@
$(NPX) ajv compile --spec=draft2019 -s $@ || rm -f $@
src/mapping/mapping.interface.ts: scripts/json-schema-to-interface.mts src/schema/mapping.schema.json
$(NPX) tsx $< src/schema/mapping.schema.json $@
$(NPX) eslint $@ --fix
src/mapping/mapping.schema.ts: scripts/json-schema-to-typescript.mts src/schema/mapping.schema.json
$(NPX) tsx $< mapping
$(NPX) eslint $@ --fix
$(NPX) prettier --write $@
.PHONY: clean
clean:
rm -f src/schema/*.json \
src/invoice/invoice.interface.ts src/mapping/mapping.interface.ts \
src/invoice/invoice.schema.ts src/mapping/mapping.schema.ts