-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMkpmfile
86 lines (69 loc) · 1.92 KB
/
Mkpmfile
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
MONOREPO := 1
include $(MKPM)/mkpm
include $(MKPM)/gnu
include $(MKPM)/envcache
include $(MKPM)/dotenv
include $(MKPM)/chain
include $(MKPM)/yarn
include $(PROJECT_ROOT)/shared.mk
ACTIONS += deps ##
$(ACTION)/deps: $(PROJECT_ROOT)/package.json $(call workspace_paths,package.json)
@$(YARN) install $(DEPS_ARGS)
@$(call done,$@)
ACTIONS += format ##
$(ACTION)/format: $(call git_deps,\.((json)|(md)|([jt]sx?))$$)
@$(call workspace_foreach,format,$(FORMAT_ARGS))
@$(call done,$@)
ACTIONS += spellcheck ##
$(ACTION)/spellcheck: $(call git_deps,\.(md)$$)
@$(call workspace_foreach,spellcheck,$(SPELLCHECK_ARGS))
@$(call done,$@)
ACTIONS += lint ##
$(ACTION)/lint: $(call git_deps,\.([jt]sx?)$$)
@$(call workspace_foreach,lint,$(LINT_ARGS))
@$(call done,$@)
ACTIONS += test ##
$(ACTION)/test: $(call git_deps,\.([jt]sx?)$$)
@$(call workspace_foreach,test,$(TEST_ARGS))
@$(call done,$@)
PACKAGES := $(shell $(LS) packages)
.PHONY: build +build
build +build:
@for t in $(patsubst %,%/$@,$(PACKAGES)); do \
$(MAKE) -sf Mkpmfile $$t; \
done
.PHONY: upgrade
upgrade: ##
@$(YARN) upgrade-interactive
.PHONY: clean
clean: ##
@$(call workspace_foreach,clean,$(CLEAN_ARGS))
-@$(MKCACHE_CLEAN)
-@$(JEST) --clearCache $(NOFAIL)
-@$(WATCHMAN) watch-del-all $(NOFAIL)
-@$(GIT) clean -fXd \
$(MKPM_GIT_CLEAN_FLAGS) \
$(YARN_GIT_CLEAN_FLAGS) \
$(NOFAIL)
.PHONY: purge
purge: clean ##
@$(GIT) clean -fXd
.PHONY: $(patsubst %,%/%,$(WORKSPACE_NAMES))
$(patsubst %,%/%,$(WORKSPACE_NAMES)):
@$(MAKE) -sC $(call map_workspace,$(@D)) $*
HELP = help
help: $(MKCHAIN_HELP)
@$(call workspace_foreach_help,$(MKCHAIN_HELP),$(ARGS))
.PHONY: count
count:
@$(CLOC) $(shell ($(GIT) ls-files && ($(GIT) lfs ls-files | $(CUT) -d' ' -f3)) | $(SORT) | $(UNIQ) -u)
.PHONY: version
version:
@$(CHANGESET)
@$(CHANGESET) version
.PHONY: publish +publish
publish: version ~build +publish
+publish:
@$(CHANGESET) publish
CACHE_ENVS += \
-include $(call chain)