Skip to content

Commit ea32b4d

Browse files
committed
fix: Include the correct bundle version in entry file header comment.
In order to have the correct version specifier in the bundle's entry script header comment the bundle must be built after the version bump. Use release-it hooks to do that.
1 parent ef70d48 commit ea32b4d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.release-it.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ module.exports = {
4545
writerOpts: {
4646
commitPartial: commits_template,
4747
},
48+
hooks: {
49+
// Run `make build` after the version is bumped to get a build
50+
// with the new version number comment in the entry scripts.
51+
// Use the make target which does a check to not build if the
52+
// package is this `@patternslib/dev` package.
53+
"after:bump": "make build",
54+
},
4855
},
4956
},
5057
};

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ bundle-pre:
5555

5656

5757
# Compile the bundle.
58+
# NOTE: When using the normal workflow - e.g. `make release-minor`, the
59+
# relase-it config runs `make build` after the version bump.
5860
.PHONY: bundle
5961
bundle: clean-dist bundle-pre stamp-yarn
6062
ifneq "$(PACKAGE_NAME)" "$(PACKAGE_DEV)"
@@ -128,7 +130,7 @@ release-github: prepare-release release-zip
128130
-rm $(BUNDLE_NAME)-bundle-$(PACKAGE_VERSION).zip
129131

130132

131-
release: clean install check bundle release-npm release-github
133+
release: clean install check release-npm release-github
132134
@# Note: If you want to include the compiled bundle in your npm package you
133135
@# have to allow it in a .npmignore file.
134136

0 commit comments

Comments
 (0)