-
Notifications
You must be signed in to change notification settings - Fork 10
/
Mkpmfile
89 lines (75 loc) · 2.25 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
87
88
89
# File: /Mkpmfile
# Project: react-ast
# File Created: 28-11-2023 02:58:22
# Author: Clay Risser
# -----
# BitSpur (c) Copyright 2019 - 2023
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
include $(MKPM)/mkpm
include $(MKPM)/gnu
include $(MKPM)/chain
include $(MKPM)/yarn
include $(MKPM)/envcache
include $(MKPM)/dotenv
CLOC ?= cloc
CSPELL ?= $(call yarn_binary,cspell)
ESLINT ?= $(call yarn_binary,eslint)
JEST ?= $(call yarn_binary,jest)
PRETTIER ?= $(call yarn_binary,prettier)
TSUP ?= $(call yarn_binary,tsup)
ACTIONS += deps
$(ACTION)/deps: package.json
@$(YARN) install $(DEPS_ARGS)
@$(call done,$@)
ACTIONS += format~deps ##
$(ACTION)/format: $(call git_deps,\.((json)|(md)|([jt]sx?))$$)
-@$(call prettier,$?,$(FORMAT_ARGS))
@$(call done,$@)
ACTIONS += spellcheck~format ##
$(ACTION)/spellcheck: $(call git_deps,\.(md)$$)
-@$(call cspell,$?,$(SPELLCHECK_ARGS))
@$(call done,$@)
ACTIONS += lint~spellcheck ##
$(ACTION)/lint: $(call git_deps,\.([jt]sx?)$$)
-@$(call eslint,$?,$(LINT_ARGS))
@$(call done,$@)
ACTIONS += test~lint ##
$(ACTION)/test: $(call git_deps,\.([jt]sx?)$$)
-@$(RM) -rf lib $(NOOUT)
-@$(call test,$?,$(TEST_ARGS))
@$(call done,$@)
ACTIONS += build~test ##
BUILD_TARGET := lib/index.js
lib/index.js:
@$(call reset,build)
$(ACTION)/build: $(call git_deps,\.([jt]sx?)$$)
@NODE_OPTIONS='--max-old-space-size=16384' $(TSUP)
@$(call done,$@)
.PHONY: count
count:
@$(CLOC) $(shell ($(GIT) ls-files && ($(GIT) lfs ls-files | $(CUT) -d' ' -f3)) | $(SORT) | $(UNIQ) -u)
.PHONY: publish +publish
publish: ~build +publish
+publish:
@$(NPM) publish --access=public
.PHONY: jest
jest:
@NODE_OPTIONS="--experimental-vm-modules" \
$(JEST) $(JEST_ARGS)
.PHONY: upgrade
upgrade:
@$(YARN) upgrade-interactive
-include $(call chain)
export CACHE_ENVS += \
TSUP