forked from marmelab/react-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
140 lines (104 loc) · 4.31 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
.PHONY: build help
help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
install: package.json ## install dependencies
@yarn
run: run-simple
run-simple: ## run the simple example
@yarn -s run-simple
run-tutorial: ## run the tutorial example
@yarn -s run-tutorial
run-demo: ## run the demo example
@yarn -s run-demo
run-demo-watch: ## run the demo example with watch on the ra dependencies
@yarn -s run-demo-watch
build-demo: ## compile the demo example to static js
@yarn -s build-demo
run-graphql-demo: ## run the demo example
@yarn -s run-graphql-demo
run-graphql-demo-watch: ## run the demo example with watch on the ra dependencies
@yarn -s run-graphql-demo-watch
build-ra-core:
@echo "Transpiling ra-core files...";
@cd ./packages/ra-core && yarn -s build
build-ra-ui-materialui:
@echo "Transpiling ra-ui-materialui files...";
@cd ./packages/ra-ui-materialui && yarn -s build
build-ra-language-english:
@echo "Transpiling ra-language-english files...";
@cd ./packages/ra-language-english && yarn -s build
build-ra-language-french:
@echo "Transpiling ra-language-french files...";
@cd ./packages/ra-language-french && yarn -s build
build-react-admin:
@echo "Transpiling react-admin files...";
@rm -rf ./packages/react-admin/docs
@cd ./packages/react-admin && yarn -s build
@mkdir packages/react-admin/docs
@cp docs/*.md packages/react-admin/docs
build-ra-data-fakerest:
@echo "Transpiling ra-data-fakerest files...";
@cd ./packages/ra-data-fakerest && yarn -s build
build-ra-data-json-server:
@echo "Transpiling ra-data-json-server files...";
@cd ./packages/ra-data-json-server && yarn -s build
build-ra-data-localstorage:
@echo "Transpiling ra-data-localstorage files...";
@cd ./packages/ra-data-localstorage && yarn -s build
build-ra-data-simple-rest:
@echo "Transpiling ra-data-simple-rest files...";
@cd ./packages/ra-data-simple-rest && yarn -s build
build-ra-data-graphql:
@echo "Transpiling ra-data-graphql files...";
@cd ./packages/ra-data-graphql && yarn -s build
build-ra-data-graphql-simple:
@echo "Transpiling ra-data-graphql-simple files...";
@cd ./packages/ra-data-graphql-simple && yarn -s build
build-ra-i18n-polyglot:
@echo "Transpiling ra-i18n-polyglot files...";
@cd ./packages/ra-i18n-polyglot && yarn -s build
build-ra-input-rich-text:
@echo "Transpiling ra-input-rich-text files...";
@cd ./packages/ra-input-rich-text && yarn -s build
build-data-generator:
@echo "Transpiling data-generator files...";
@cd ./examples/data-generator && yarn -s build
build: build-ra-core build-ra-ui-materialui build-ra-data-fakerest build-ra-data-json-server build-ra-data-localstorage build-ra-data-simple-rest build-ra-data-graphql build-ra-data-graphql-simple build-ra-i18n-polyglot build-ra-input-rich-text build-data-generator build-ra-language-english build-ra-language-french build-react-admin ## compile ES6 files to JS
doc: ## compile doc as html and launch doc web server
@yarn -s doc
serve-github-pages: ## Serve the doc from a Github Pages docker container
@docker run -it --rm \
-p 4000:4000 \
-v "${PWD}/docs:/usr/src/app" \
starefossen/github-pages:onbuild \
jekyll serve \
--host=0.0.0.0 \
--incremental
lint: ## lint the code and check coding conventions
@echo "Running linter..."
@yarn -s lint
prettier: ## prettify the source code using prettier
@echo "Running prettier..."
@yarn -s prettier
test: build test-unit lint test-e2e ## launch all tests
test-unit: ## launch unit tests
@if [ "$(CI)" != "true" ]; then \
echo "Running unit tests..."; \
yarn -s test-unit; \
fi
@if [ "$(CI)" = "true" ]; then \
echo "Running unit tests in CI..."; \
yarn -s test-unit-ci; \
fi
test-unit-watch: ## launch unit tests and watch for changes
echo "Running unit tests..."; \
yarn -s test-unit --watch; \
test-e2e: ## launch end-to-end tests (ex. BROWSER=firefox make test-e2e)
@if [ "$(build)" != "false" ]; then \
echo 'Building example code (call "make build=false test-e2e" to skip the build)...'; \
cd examples/simple && BABEL_ENV=cjs yarn -s build; \
fi
@NODE_ENV=test cd cypress && yarn -s test
test-e2e-local: ## launch end-to-end tests for development
@echo 'Starting e2e tests environment. Ensure you started the simple example first (make run-simple)'
@cd cypress && yarn -s start