1+ # #############
2+ # # Please note
3+ # #############
4+
5+ # First, run ``make install``.
6+ # After that you have through Makefile extension all the other base targets available.
7+
8+ # If you want to release on GitHub, make sure to have a .env file with a GITHUB_TOKEN.
9+ # Also see:
10+ # https://github.com/settings/tokens
11+ # and https://github.com/release-it/release-it/blob/master/docs/github-releases.md#automated
12+
13+
14+ # Include base Makefile
15+ -include node_modules/@patternslib/dev/Makefile
16+
117# Define the GITHUB_TOKEN in the .env file for usage with release-it.
218-include .env
319export
420
5- ESLINT ?= npx eslint
621PEGJS ?= npx pegjs
722SASS ?= npx sass
823YARN ?= npx yarn
924
10- SOURCES = $(wildcard src/* .js) $(wildcard src/pat/* .js) $(wildcard src/lib/* .js)
11- GENERATED = src/lib/depends_parse.js
12-
1325PACKAGE_NAME = "patternslib"
1426
1527all :: bundle css
1628
1729
18- # #######################################################################
19- # # Install dependencies
20-
2130.PHONY : install
2231stamp-yarn install :
2332 $(YARN ) install
@@ -27,130 +36,17 @@ stamp-yarn install:
2736 # $(YARN) husky add .husky/commit-msg "npx yarn commitlint --edit $1"
2837 touch stamp-yarn
2938
30- clean-dist :
31- rm -Rf dist/
32-
33- .PHONY : clean
34- clean : clean-dist
35- rm -f stamp-yarn
36- rm -Rf node_modules/
37-
38- # #######################################################################
39- # # Tests
40-
41- .PHONY : eslint
42- eslint : stamp-yarn
43- $(ESLINT ) ./src
44-
45- .PHONY : check
46- check : stamp-yarn eslint
47- $(YARN ) run testonce
48-
49-
50- # #######################################################################
51- # # Builds
5239
5340.PHONY : build
54- build : bundle all-css
55-
56- .PHONY : bundle
57- bundle : stamp-yarn
58- $(YARN ) run build
59-
60- release-zip : clean-dist bundle
61- $(eval PACKAGE_VERSION := $(shell node -p "require('./package.json') .version") )
62- @echo name is $(PACKAGE_NAME )
63- @echo version is $(PACKAGE_VERSION )
64- mkdir -p dist/$(PACKAGE_NAME ) -bundle-$(PACKAGE_VERSION )
65- -mv dist/* dist/$(PACKAGE_NAME ) -bundle-$(PACKAGE_VERSION )
66- cd dist/ && zip -r $(PACKAGE_NAME ) -bundle-$(PACKAGE_VERSION ) .zip $(PACKAGE_NAME ) -bundle-$(PACKAGE_VERSION ) /
67-
68- .PHONY : release-major
69- release-major : check
70- npx release-it major && \
71- make release-zip && \
72- npx release-it --github.release --github.update --github.assets=dist/* .zip --no-github.draft --no-increment --no-git --no-npm && \
73- git checkout CHANGES.md
74-
75- .PHONY : release-minor
76- release-minor : check
77- npx release-it minor && \
78- make release-zip && \
79- npx release-it --github.release --github.update --github.assets=dist/* .zip --no-github.draft --no-increment --no-git --no-npm && \
80- git checkout CHANGES.md
81-
82- .PHONY : release-patch
83- release-patch : check
84- npx release-it patch && \
85- make release-zip && \
86- npx release-it --github.release --github.update --github.assets=dist/* .zip --no-github.draft --no-increment --no-git --no-npm && \
87- git checkout CHANGES.md
88-
89- .PHONY : prerelease-alpha
90- prerelease-alpha : clean install
91- npx release-it --preRelease=alpha && \
92- make release-zip && \
93- npx release-it --github.preRelease --github.update --github.assets=dist/* .zip --no-github.draft --no-increment --no-git --no-npm && \
94- git checkout CHANGES.md
95-
96- .PHONY : prerelease-beta
97- prerelease-beta : clean install
98- npx release-it --preRelease=beta && \
99- make release-zip && \
100- npx release-it --github.preRelease --github.update --github.assets=dist/* .zip --no-github.draft --no-increment --no-git --no-npm && \
101- git checkout CHANGES.md
41+ build : bundle css
42+
10243
10344src/lib/depends_parse.js : src/lib/depends_parse.pegjs stamp-yarn
10445 $(PEGJS ) $<
10546 sed -i~ -e ' 1s/.*/define(function() {/' -e ' $$s/()//' $@ || rm -f $@
10647
107- .PHONY : all-css
108- all-css : css
109- @echo " Hang tight!"
110- @$(SASS ) -I . -I _sass src/pat/auto-scale/_auto-scale.scss src/pat/auto-scale/auto-scale.css
111- @$(SASS ) -I . -I _sass src/pat/auto-suggest/_auto-suggest.scss src/pat/auto-suggest/auto-suggest.css
112- @$(SASS ) -I . -I _sass src/pat/bumper/_bumper.scss src/pat/bumper/bumper.css
113- @$(SASS ) -I . -I _sass src/pat/carousel/_carousel.scss src/pat/carousel/carousel.css
114- @$(SASS ) -I . -I _sass src/pat/checklist/_checklist.scss src/pat/checklist/checklist.css
115- @$(SASS ) -I . -I _sass src/pat/collapsible/_collapsible.scss src/pat/collapsible/collapsible.css
116- @$(SASS ) -I . -I _sass src/pat/colour-picker/_colour-picker.scss src/pat/colour-picker/colour-picker.css
117- @$(SASS ) -I . -I _sass src/pat/date-picker/_date-picker.scss src/pat/date-picker/date-picker.css
118- @$(SASS ) -I . -I _sass src/pat/datetime-picker/_datetime-picker.scss src/pat/datetime-picker/datetime-picker.css
119- @$(SASS ) -I . -I _sass src/pat/equaliser/_equaliser.scss src/pat/equaliser/equaliser.css
120- @$(SASS ) -I . -I _sass src/pat/expandable-tree/_expandable-tree.scss src/pat/expandable-tree/expandable-tree.css
121- @$(SASS ) -I . -I _sass src/pat/focus/_focus.scss src/pat/focus/focus.css
122- @$(SASS ) -I . -I _sass src/pat/gallery/_gallery.scss src/pat/gallery/gallery.css
123- @echo " Almost there, don't give up!"
124- @$(SASS ) -I . -I _sass src/pat/grid/_grid.scss src/pat/grid/grid.css
125- @$(SASS ) -I . -I _sass src/pat/image-crop/_image-crop.scss src/pat/image-crop/image-crop.css
126- @$(SASS ) -I . -I _sass src/pat/inject/_inject.scss src/pat/inject/inject.css
127- @$(SASS ) -I . -I _sass src/pat/masonry/_masonry.scss src/pat/masonry/masonry.css
128- @$(SASS ) -I . -I _sass src/pat/menu/_menu.scss src/pat/menu/menu.css
129- @$(SASS ) -I . -I _sass src/pat/modal/_modal.scss src/pat/modal/modal.css
130- @$(SASS ) -I . -I _sass src/pat/notification/_notification.scss src/pat/notification/notification.css
131- @$(SASS ) -I . -I _sass src/pat/sortable/_sortable.scss src/pat/sortable/sortable.css
132- @$(SASS ) -I . -I _sass src/pat/stacks/_stacks.scss src/pat/stacks/stacks.css
133- @$(SASS ) -I . -I _sass src/pat/switch/_switch.scss src/pat/switch/switch.css
134- @$(SASS ) -I . -I _sass src/pat/syntax-highlight/_syntax-highlight.scss src/pat/syntax-highlight/syntax-highlight.css
135- @$(SASS ) -I . -I _sass src/pat/toggle/_toggle.scss src/pat/toggle/toggle.css
136- @$(SASS ) -I . -I _sass src/pat/tooltip/_tooltip.scss src/pat/tooltip/tooltip.css
137- @echo " Done. Each pattern now has a CSS file."
13848
13949.PHONY : css
14050css :
14151 @$(SASS ) -I style -I _sass -I . _sass/_patterns.scss style/patterns.css
14252
143- .PHONY : watch
144- watch :
145- $(SASS ) --watch -I style -I . -I _sass _sass/_patterns.scss:style/patterns.css
146-
147- # #######################################################################
148-
149- .PHONY : serve
150- serve : bundle css
151- $(YARN ) run start
152- @printf " \nBundle built\n\n"
153-
154- .PHONY : designerhappy
155- designerhappy : serve
156-
0 commit comments