aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 041e705c6fe7c945ee76f24b0b99ec8c4ab775c8 (plain)
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
50
51
52
53
WIKIDIR ?= ../../vendor/wiki
default: wiki

prepare:
	@pnpm install
	@cd $(WIKIDIR) && pnpm install

# Code Quality

test:
	node --test

coverage:
	node --test --experimental-test-coverage

lint: prepare
	@pnpm exec eslint ./src --fix

format: lint
	@pnpm exec prettier ./src --write

# Development

build: prepare
	@pnpx esbuild src/client.js --bundle --outfile=client/security.js

watch:
	@nodemon -e js,html,css -i client/security.js --exec make build

wiki: build
	@cd $(WIKIDIR) && node index.js --data ./data --config ./config.json

link:
	@pnpm link
	@cd $(WIKIDIR) && pnpm link wiki-security-oidc

# Deployment

release:
	@pnpm publish

# Auditing

sbom:
	@trivy fs -q --format cyclonedx --scanners vuln,license --output sbom.json .

vulnerabilities: sbom
	@sbom-utility vulnerability list -q --input-file sbom.json

licenses: sbom
	@sbom-utility license list -q --input-file sbom.json

.PHONY: default prepare test coverage format lint release ci link wiki build watch