|
1 | | --include .env |
2 | | -export |
3 | | - |
4 | | -ESLINT ?= npx eslint |
5 | | -YARN ?= npx yarn |
6 | | - |
7 | | - |
8 | | -.PHONY: install |
9 | | -stamp-yarn install: |
10 | | - $(YARN) install |
11 | | - # Install pre commit hook |
12 | | - $(YARN) husky install |
13 | | - touch stamp-yarn |
14 | | - |
15 | | - |
16 | | -clean-dist: |
17 | | - rm -Rf dist/ |
18 | | - |
19 | | - |
20 | | -.PHONY: clean |
21 | | -clean: clean-dist |
22 | | - rm -f stamp-yarn |
23 | | - rm -Rf node_modules/ |
24 | | - |
25 | | - |
26 | | -eslint: stamp-yarn |
27 | | - $(ESLINT) ./src |
28 | | - |
29 | | - |
30 | | -.PHONY: check |
31 | | -check:: stamp-yarn eslint |
32 | | - $(YARN) run test |
33 | | - |
34 | | - |
35 | | -.PHONY: bundle |
36 | | -bundle: stamp-yarn |
37 | | - $(YARN) run build |
| 1 | + ############## |
| 2 | +## Please note |
| 3 | +############## |
38 | 4 |
|
| 5 | +# First, run ``make install``. |
| 6 | +# After that you have through Makefile extension all the other base targets available. |
39 | 7 |
|
40 | 8 | # If you want to release on GitHub, make sure to have a .env file with a GITHUB_TOKEN. |
41 | 9 | # Also see: |
42 | 10 | # https://github.com/settings/tokens |
43 | 11 | # and https://github.com/release-it/release-it/blob/master/docs/github-releases.md#automated |
44 | 12 |
|
45 | 13 |
|
46 | | -release-zip: clean-dist bundle |
47 | | - $(eval PACKAGE_NAME := $(subst @patternslib/,,$(shell node -p "require('./package.json').name"))) |
48 | | - $(eval PACKAGE_VERSION := $(shell node -p "require('./package.json').version")) |
49 | | - @echo name is $(PACKAGE_NAME) |
50 | | - @echo version is $(PACKAGE_VERSION) |
51 | | - mkdir -p dist/$(PACKAGE_NAME)-bundle-$(PACKAGE_VERSION) |
52 | | - -mv dist/* dist/$(PACKAGE_NAME)-bundle-$(PACKAGE_VERSION) |
53 | | - cd dist/ && zip -r $(PACKAGE_NAME)-bundle-$(PACKAGE_VERSION).zip $(PACKAGE_NAME)-bundle-$(PACKAGE_VERSION)/ |
54 | | - |
55 | | - |
56 | | -.PHONY: release-major |
57 | | -release-major: check |
58 | | - npx release-it major && \ |
59 | | - make release-zip && \ |
60 | | - npx release-it --github.release --github.update --github.assets=dist/*.zip --no-github.draft --no-increment --no-git --no-npm && \ |
61 | | - git checkout CHANGES.md |
62 | | - |
63 | | -.PHONY: release-minor |
64 | | -release-minor: check |
65 | | - npx release-it minor && \ |
66 | | - make release-zip && \ |
67 | | - npx release-it --github.release --github.update --github.assets=dist/*.zip --no-github.draft --no-increment --no-git --no-npm && \ |
68 | | - git checkout CHANGES.md |
69 | | - |
70 | | -.PHONY: release-patch |
71 | | -release-patch: check |
72 | | - npx release-it patch && \ |
73 | | - make release-zip && \ |
74 | | - npx release-it --github.release --github.update --github.assets=dist/*.zip --no-github.draft --no-increment --no-git --no-npm && \ |
75 | | - git checkout CHANGES.md |
| 14 | +# Include base Makefile |
| 15 | +-include node_modules/@patternslib/dev/Makefile |
76 | 16 |
|
77 | | -.PHONY: prerelease-alpha |
78 | | -prerelease-alpha: clean install |
79 | | - npx release-it --preRelease=alpha && \ |
80 | | - make release-zip && \ |
81 | | - npx release-it --github.release --github.update --github.assets=dist/*.zip --no-github.draft --no-increment --no-git --no-npm && \ |
82 | | - git checkout CHANGES.md |
83 | | - |
84 | | -.PHONY: prerelease-beta |
85 | | -prerelease-beta: clean install |
86 | | - npx release-it --preRelease=beta && \ |
87 | | - make release-zip && \ |
88 | | - npx release-it --github.release --github.update --github.assets=dist/*.zip --no-github.draft --no-increment --no-git --no-npm && \ |
89 | | - git checkout CHANGES.md |
| 17 | +# Define the GITHUB_TOKEN in the .env file for usage with release-it. |
| 18 | +-include .env |
| 19 | +export |
90 | 20 |
|
91 | 21 |
|
92 | | -.PHONY: serve |
93 | | -serve:: stamp-yarn |
94 | | - $(YARN) run start |
| 22 | +.PHONY: install |
| 23 | +stamp-yarn install: |
| 24 | + npx yarn install |
| 25 | + # Install pre commit hook |
| 26 | + npx yarn husky install |
| 27 | + touch stamp-yarn |
95 | 28 |
|
96 | 29 |
|
97 | 30 | # |
0 commit comments