Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (39 loc) · 1.83 KB
/
Copy pathMakefile
File metadata and controls
61 lines (39 loc) · 1.83 KB
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
54
55
56
57
58
59
60
61
.PHONY: all run clean cleaner host fallback preact lint test
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
scripts=$(call rwildcard, $1/, *.tsx) $(call rwildcard, $1/, *.ts)
all: host fallback preact
run: all
node --trace-warnings --inspect dist/mobius.js --base ../mobius-sample --source-map --workers 2
clean:
rm -rf dist/ mobius-*.tgz
cleaner: clean
rm -rf node_modules
lint:
node_modules/.bin/tslint -c tslint.json 'host/**/*.ts' 'common/**/*.ts' 'server/**/*.ts' 'client/**/*.ts' mobius.ts --fix
output-test: all
tests/compare-expected.sh tests/randomness
test: lint output-test
preact: dist/common/preact.js dist/common/preact.d.ts
dist/common/:
mkdir -p $@
node_modules/preact/dist/preact.esm.js: $(call rwildcard, node_modules/preact/src/, *.js)
# Global tools that preact requires be available
npm install -g npm-run-all rollup babel-cli jscodeshift gzip-size-cli rimraf
cd node_modules/preact && npm version --allow-same-version 0.0.1 && npm install && npm run-script transpile
dist/common/preact.js: node_modules/preact/dist/preact.esm.js dist/common/
cp $< $@
dist/common/preact.d.ts: node_modules/preact/src/preact.d.ts dist/common/
cp $< $@
host: dist/mobius.js
dist/mobius.js: $(call scripts, host) $(call scripts, common) mobius.ts types/*.d.ts server/mobius.d.ts tsconfig-host.json
node_modules/.bin/tsc -p tsconfig-host.json
chmod +x dist/mobius.js
fallback: dist/fallback.min.js
dist/:
mkdir -p dist/
dist/diff-match-patch.js: dist/
grep -v module.exports node_modules/diff-match-patch/index.js > $@
dist/fallback.js: mobius-fallback.ts dist/diff-match-patch.js types/*.d.ts tsconfig-fallback.json dist/
node_modules/.bin/tsc -p tsconfig-fallback.json
dist/fallback.min.js: dist/fallback.js
node_modules/.bin/google-closure-compiler-js --languageOut ES3 --jsCode $< > $@