UNPKG

2.29 kBPlain TextView Raw
1# TESTS
2
3TESTER = ./node_modules/.bin/mocha
4OPTS = --require ./test/init.js
5TESTS = test/*.test.js
6JSHINT = ./node_modules/.bin/jshint
7
8test:
9 $(TESTER) $(OPTS) $(TESTS)
10test-verbose:
11 $(TESTER) $(OPTS) --reporter spec $(TESTS)
12testing:
13 $(TESTER) $(OPTS) --watch $(TESTS)
14
15JS_FILES = $(shell find . -type f -name "*.js" \
16 -not -path "./node_modules/*" -and \
17 -not -path "./coverage/*" -and \
18 -not -path "./test/*" -and \
19 -not -path "./docs/*" -and \
20 -not -path "./vendor/*" -and \
21 -not -path "./templates/*" -and \
22 -not -path "./db/schema.js")
23
24check:
25 @$(JSHINT) $(JS_FILES)
26
27# MAN DOCS
28
29CLI_MAN = $(shell find docs/cli -name '*.md' \
30 |sed 's|.md|.1|g' \
31 |sed 's|docs/cli/|man/|g' )
32
33API_MAN = $(shell find docs/api -name '*.md' \
34 |sed 's|.md|.3|g' \
35 |sed 's|docs/api/|man/|g' )
36
37CLI_WEB = $(shell find docs/cli -name '*.md' \
38 |sed 's|.md|.1.html|g' \
39 |sed 's|docs/cli/|man/html/|g' )
40
41API_WEB = $(shell find docs/api -name '*.md' \
42 |sed 's|.md|.3.html|g' \
43 |sed 's|docs/api/|man/html/|g' ) \
44 man/html/railway-changelog.3.html \
45 man/html/changelog.3.html \
46
47man/%.1: docs/cli/%.md scripts/doc.sh
48 @[ -d man ] || mkdir man
49 scripts/doc.sh $< $@
50
51man/%.3: docs/api/%.md scripts/doc.sh
52 @[ -d man ] || mkdir man
53 scripts/doc.sh $< $@
54
55man/html/%.3.html: docs/api/%.md scripts/doc.sh docs/footer.html
56 @[ -d man/html ] || mkdir -p man/html
57 scripts/doc.sh $< $@
58
59man/html/%.1.html: docs/cli/%.md scripts/doc.sh
60 @[ -d man/html ] || mkdir -p man/html
61 scripts/doc.sh $< $@
62
63man/html/railway-changelog.3.html: RAILWAY-CHANGELOG.md scripts/doc.sh
64 scripts/doc.sh $< $@
65
66man/html/changelog.3.html: CHANGELOG.md scripts/doc.sh
67 scripts/doc.sh $< $@
68
69MAN = $(API_MAN) $(CLI_MAN)
70
71build: man
72
73html: $(API_WEB) $(CLI_WEB)
74
75web: $(API_WEB)
76 rsync ./man/html/* compoundjs.com:/var/www/apps/compoundjs.com/public/man
77 scp ./docs/index.html compoundjs.com:/var/www/apps/compoundjs.com/compound/docs
78
79all: $(MAN) $(API_WEB)
80
81man: $(MAN)
82
83# WEBSITE DOCS
84
85docs:
86 node docs/sources/build
87apidocs:
88 makedoc lib/*.js lib/*/*.js -t "RailwayJS API docs" -g "1602/express-on-railway" --assets
89
90.PHONY: test doc docs