This repository was archived by the owner on Jul 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (57 loc) · 2.07 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
# Install pnpm and lerna
deps-platform:
npm install --global --force [email protected] lerna
# Install JS packages
deps-project:
pnpm install --frozen-lockfile
# Preprocess resources required to test or build packages
prepare:
lerna run build
# Run lint / static testing
lint:
lerna run lint
format-check:
lerna run format:check
# Local bearer is expected in ./bin/bearer
LOCAL_BEARER := ./bin/bearer
BEARER_CONFIG := ./bearer.yml
# Run bearer; installs if not already installed, then loops through each package and runs bearer if it has a JS folder and a package.json
# Skips ui-icons as the files are trivial and it slows down the testing a lot
bearer:
@if [ ! -f "$(LOCAL_BEARER)" ]; then \
echo "Installing Bearer"; \
curl -sfL https://raw.githubusercontent.com/Bearer/bearer/main/contrib/install.sh | sh; \
fi
@for package in $(shell ls packages) ; do \
if [ -d "packages/$$package/src" ]; then \
if [ $$package = "ui-icons" ]; then \
continue; \
fi; \
echo "Running Bearer for $$package"; \
cd packages/$$package && ../../$(LOCAL_BEARER) scan src --force --config-file ../../$(BEARER_CONFIG); \
EXIT_CODE=$$?; \
if [ $$EXIT_CODE -ne 0 ]; then \
exit $$EXIT_CODE; \
fi; \
cd ../..; \
fi \
done
# Run tests
test:
lerna run test
version-patch:
@pnpm lerna version patch --no-git-tag-version --force-publish --yes && pnpm i --lockfile-only && borg version patch && borg lock
version-minor:
@pnpm lerna version minor --no-git-tag-version --force-publish --yes && pnpm i --lockfile-only && borg version minor && borg lock
version-major:
@pnpm lerna version major --no-git-tag-version --force-publish --yes && pnpm i --lockfile-only && borg version major && borg lock
# Publish all the packages to the appropriate repositories
publish:
git reset --hard
echo "//registry.npmjs.org/:_authToken=$${NPMJS_TOKEN}" >> .npmrc
git update-index --assume-unchanged .npmrc
lerna publish from-package --yes --no-git-reset --no-push --no-git-tag-version --force-publish
sed -i '$$ d' .npmrc
# Clean development artifacts from the repository
clean:
git clean -xfd .