bumpp.config.ts
Describe the bug
你好,我现在正在研究这个包的用法,但是我发现配置了bumpp.config.ts配置并不生效,然后我看了下源代码
是不是name参数配置有误
Reproduction
const { config } = await loadConfig<VersionBumpOptions>({ name: 'bump', defaults: bumpConfigDefaults, overrides: { ...(overrides as VersionBumpOptions), }, cwd, })
System Info
System:
OS: macOS 13.3.1
CPU: (12) arm64 Apple M2 Max
Memory: 481.25 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.18.1 - ~/.nvm/versions/node/v16.18.1/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.18.1/bin/yarn
npm: 8.19.2 - ~/.nvm/versions/node/v16.18.1/bin/npm
Browsers:
Safari: 16.4
Used Package Manager
pnpm
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guide.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [X] The provided reproduction is a minimal reproducible of the bug.
Seems like it should be name: "bumpp" or the docs should be changed:
https://github.com/antfu/bumpp/blame/main/README.md#L17
确实,调试半天发现名字不对……
Reproduction:
https://codesandbox.io/p/sandbox/reproduction-bumpp-config-file-jywcm5
Description & Findings
It was mentioned that certain versions may behave differently from one another.
I created reproductions to test and see which config file does work and how it should be named.
Additionally, I tested if the configuration settings actually take effect while I was at it.
The full results are below, but the findings are:
Both tested version (9.1.0 and 9.2.0) load the config from bump.config.ts (note that it's written with just one p). This is currently correct in the "demo bump config file in the repo" but wrong in the official README.md.
On this topic of config file name: I personally would vote for the config file to be named bumpp.config.ts (two pp). However, moving to this new file name would probably mean to support both file names for backward compatibility.
Additionally (and maybe more importantly):
This is also in a new issue: #19
The settings for commit and tag appear to be completely ignored when set to false or even when set to a string (e.g. jumpy or ju-%s-py). Docs say that these should be used for naming the version (when string used) or to disable tag and commit respectively.
The only one that appears to be working is push: false which actually prevents the git push.
I did not test the all: false/true or execute parameter.
Test Results:
bumpp-v9.1.0-bump.config.ts
- finds
bump.config.ts - does not respect any of the parameters except
push: false - it also actually tries to commit/tag/etc.
bumpp-v9.1.0-bumpp.config.ts
- does not find
bumpp.config.ts
bumpp-v9.2.0-bump.config.ts
- finds
bump.config.ts - does not respect any of the parameters except
push: false -
commitandtagare ignored if set tofalseor if seet to a string e.g.jumpyorju-%s-py - it also actually tries to commit/tag/etc.
bumpp-v9.2.0-bumpp.config.ts
- does not find
bumpp.config.ts
I just tested this with bumpp v9.4.0 upgraded and the problem does not seem to have been fixed. At least the settings are ignored when using bumpp.config.ts but they are found (but partially) with bump.config.ts.
bumpp.config.ts (does not respect the config parameters)
bump.config.ts (respects some of the config parameters)
Not sure why, since I did try to see into the code and it looks like some merging / overwriting and loading of both config files is happening.