1 | # TESTS
|
2 |
|
3 | TESTER = ./node_modules/.bin/mocha
|
4 | OPTS = --require ./test/init.js
|
5 | TESTS = test/*.test.js
|
6 | JSHINT = ./node_modules/.bin/jshint
|
7 |
|
8 | test:
|
9 | $(TESTER) $(OPTS) $(TESTS)
|
10 | test-verbose:
|
11 | $(TESTER) $(OPTS) --reporter spec $(TESTS)
|
12 | testing:
|
13 | $(TESTER) $(OPTS) --watch $(TESTS)
|
14 |
|
15 | JS_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 |
|
24 | check:
|
25 | @$(JSHINT) $(JS_FILES)
|
26 |
|
27 | # MAN DOCS
|
28 |
|
29 | CLI_MAN = $(shell find docs/cli -name '*.md' \
|
30 | |sed 's|.md|.1|g' \
|
31 | |sed 's|docs/cli/|man/|g' )
|
32 |
|
33 | API_MAN = $(shell find docs/api -name '*.md' \
|
34 | |sed 's|.md|.3|g' \
|
35 | |sed 's|docs/api/|man/|g' )
|
36 |
|
37 | CLI_WEB = $(shell find docs/cli -name '*.md' \
|
38 | |sed 's|.md|.1.html|g' \
|
39 | |sed 's|docs/cli/|man/html/|g' )
|
40 |
|
41 | API_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 |
|
47 | man/%.1: docs/cli/%.md scripts/doc.sh
|
48 | @[ -d man ] || mkdir man
|
49 | scripts/doc.sh $< $@
|
50 |
|
51 | man/%.3: docs/api/%.md scripts/doc.sh
|
52 | @[ -d man ] || mkdir man
|
53 | scripts/doc.sh $< $@
|
54 |
|
55 | man/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 |
|
59 | man/html/%.1.html: docs/cli/%.md scripts/doc.sh
|
60 | @[ -d man/html ] || mkdir -p man/html
|
61 | scripts/doc.sh $< $@
|
62 |
|
63 | man/html/railway-changelog.3.html: RAILWAY-CHANGELOG.md scripts/doc.sh
|
64 | scripts/doc.sh $< $@
|
65 |
|
66 | man/html/changelog.3.html: CHANGELOG.md scripts/doc.sh
|
67 | scripts/doc.sh $< $@
|
68 |
|
69 | MAN = $(API_MAN) $(CLI_MAN)
|
70 |
|
71 | build: man
|
72 |
|
73 | html: $(API_WEB) $(CLI_WEB)
|
74 |
|
75 | web: $(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 |
|
79 | all: $(MAN) $(API_WEB)
|
80 |
|
81 | man: $(MAN)
|
82 |
|
83 | # WEBSITE DOCS
|
84 |
|
85 | docs:
|
86 | node docs/sources/build
|
87 | apidocs:
|
88 | makedoc lib/*.js lib/*/*.js -t "RailwayJS API docs" -g "1602/express-on-railway" --assets
|
89 |
|
90 | .PHONY: test doc docs
|