Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
.env
dist/
node_modules/
stamp-yarn
stats.json
yarn-error.log
pat-*
28 changes: 18 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,37 @@ PACKAGE_DEV=@patternslib/dev
PACKAGE_NAME := $(shell node -p "require('./package.json').name")
BUNDLE_NAME := $(subst @patternslib/,,$(subst @plone/,,$(PACKAGE_NAME)))

.PHONY: install
stamp-yarn install:

yarn.lock install: .git/hooks/commit-msg
$(YARN) install
# Install pre commit hook
$(YARN) husky install
touch stamp-yarn


.git/hooks/commit-msg:
echo "npx commitlint --edit" > .git/hooks/commit-msg
chmod u+x .git/hooks/commit-msg


.PHONY: clean
clean-dist:
rm -Rf dist/


.PHONY: clean
clean: clean-dist
rm -f stamp-yarn
rm -Rf node_modules/


.PHONY: eslint
eslint: stamp-yarn
eslint: install
$(ESLINT) ./src


.PHONY: check
check: stamp-yarn eslint
check: install eslint
$(YARN) run test


.PHONY: bundle-pre
bundle-pre:
@# Override this in your project to add some tasks before the bundle is built.
@# Example: Unlink any linked dependencies.
Expand All @@ -58,14 +61,15 @@ bundle-pre:
# NOTE: When using the normal workflow - e.g. `make release-minor`, the
# relase-it config runs `make bundle` after the version bump.
.PHONY: bundle
bundle: clean-dist bundle-pre stamp-yarn
bundle: clean-dist bundle-pre install
ifneq "$(PACKAGE_NAME)" "$(PACKAGE_DEV)"
@# Do not build a bundle for @patternslib/dev
$(YARN) run build
endif


# Create a ZIP file from the bundle which is uploaded to the GitHub release tag.
.PHONY: release-zip
release-zip:
ifneq "$(PACKAGE_NAME)" "$(PACKAGE_DEV)"
@# Do not create a zip release for @patternslib/dev
Expand All @@ -79,6 +83,7 @@ endif


# Prepare some necessary variables.
.PHONY: prepare-release
prepare-release:
ifeq ($(LEVEL),$(filter $(LEVEL), alpha beta))
@# case alpha or beta pre-release
Expand All @@ -104,11 +109,13 @@ endif


# Do the npm release.
.PHONY: release-npm
release-npm: prepare-release
npx release-it $(RELEASE_IT_LEVEL)


# Do the GitHub release.
.PHONY: release-github
release-github: prepare-release release-zip
@# NOTE: PACKAGE_VERSION is defined in release-zip

Expand All @@ -130,6 +137,7 @@ release-github: prepare-release release-zip
-rm $(BUNDLE_NAME)-bundle-$(PACKAGE_VERSION).zip


.PHONY: release
release: clean install check release-npm release-github
@# Note: If you want to include the compiled bundle in your npm package you
@# have to allow it in a .npmignore file.
Expand Down Expand Up @@ -159,7 +167,7 @@ prerelease-beta:


.PHONY: serve
serve: stamp-yarn
serve: install
$(YARN) run start


Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"css-loader": "^7.1.2",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"husky": "^8.0.3",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4497,11 +4497,6 @@ human-signals@^5.0.0:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28"
integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==

husky@^8.0.3:
version "8.0.3"
resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184"
integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==

hyperdyperid@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/hyperdyperid/-/hyperdyperid-1.2.0.tgz#59668d323ada92228d2a869d3e474d5a33b69e6b"
Expand Down