-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
breaking: Extend Makefile from @patternslib/dev.
- Loading branch information
Showing
2 changed files
with
19 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,96 +1,30 @@ | ||
-include .env | ||
export | ||
|
||
ESLINT ?= npx eslint | ||
YARN ?= npx yarn | ||
|
||
|
||
stamp-yarn: | ||
$(YARN) install | ||
# Install pre commit hook | ||
$(YARN) husky install | ||
touch stamp-yarn | ||
|
||
|
||
clean-dist: | ||
rm -Rf dist/ | ||
|
||
|
||
.PHONY: clean | ||
clean: clean-dist | ||
rm -f stamp-yarn | ||
rm -Rf node_modules/ | ||
|
||
|
||
eslint: stamp-yarn | ||
$(ESLINT) ./src | ||
|
||
|
||
.PHONY: check | ||
check:: stamp-yarn eslint | ||
$(YARN) run test | ||
|
||
|
||
.PHONY: bundle | ||
bundle: stamp-yarn | ||
$(YARN) run build | ||
############## | ||
## Please note | ||
############## | ||
|
||
# First, run ``make install``. | ||
# After that you have through Makefile extension all the other base targets available. | ||
|
||
# If you want to release on GitHub, make sure to have a .env file with a GITHUB_TOKEN. | ||
# Also see: | ||
# https://github.com/settings/tokens | ||
# and https://github.com/release-it/release-it/blob/master/docs/github-releases.md#automated | ||
|
||
|
||
release-zip: clean-dist bundle | ||
$(eval PACKAGE_NAME := $(subst @patternslib/,,$(shell node -p "require('./package.json').name"))) | ||
$(eval PACKAGE_VERSION := $(shell node -p "require('./package.json').version")) | ||
@echo name is $(PACKAGE_NAME) | ||
@echo version is $(PACKAGE_VERSION) | ||
mkdir -p dist/$(PACKAGE_NAME)-bundle-$(PACKAGE_VERSION) | ||
-mv dist/* dist/$(PACKAGE_NAME)-bundle-$(PACKAGE_VERSION) | ||
cd dist/ && zip -r $(PACKAGE_NAME)-bundle-$(PACKAGE_VERSION).zip $(PACKAGE_NAME)-bundle-$(PACKAGE_VERSION)/ | ||
|
||
|
||
.PHONY: release-major | ||
release-major: check | ||
npx release-it major && \ | ||
make release-zip && \ | ||
npx release-it --github.release --github.update --github.assets=dist/*.zip --no-github.draft --no-increment --no-git --no-npm && \ | ||
git checkout CHANGES.md | ||
|
||
.PHONY: release-minor | ||
release-minor: check | ||
npx release-it minor && \ | ||
make release-zip && \ | ||
npx release-it --github.release --github.update --github.assets=dist/*.zip --no-github.draft --no-increment --no-git --no-npm && \ | ||
git checkout CHANGES.md | ||
# Include base Makefile | ||
-include node_modules/@patternslib/dev/Makefile | ||
|
||
.PHONY: release-patch | ||
release-patch: check | ||
npx release-it patch && \ | ||
make release-zip && \ | ||
npx release-it --github.release --github.update --github.assets=dist/*.zip --no-github.draft --no-increment --no-git --no-npm && \ | ||
git checkout CHANGES.md | ||
|
||
.PHONY: prerelease-alpha | ||
prerelease-alpha: clean install | ||
npx release-it --preRelease=alpha && \ | ||
make release-zip && \ | ||
npx release-it --github.release --github.update --github.assets=dist/*.zip --no-github.draft --no-increment --no-git --no-npm && \ | ||
git checkout CHANGES.md | ||
|
||
.PHONY: prerelease-beta | ||
prerelease-beta: clean install | ||
npx release-it --preRelease=beta && \ | ||
make release-zip && \ | ||
npx release-it --github.release --github.update --github.assets=dist/*.zip --no-github.draft --no-increment --no-git --no-npm && \ | ||
git checkout CHANGES.md | ||
# Define the GITHUB_TOKEN in the .env file for usage with release-it. | ||
-include .env | ||
export | ||
|
||
|
||
.PHONY: serve | ||
serve:: stamp-yarn | ||
$(YARN) run start | ||
.PHONY: install | ||
stamp-yarn install: | ||
npx yarn install | ||
# Install pre commit hook | ||
npx yarn husky install | ||
touch stamp-yarn | ||
|
||
|
||
# |