bumpp icon indicating copy to clipboard operation
bumpp copied to clipboard

bumpp.config.ts

Open SenRanYo opened this issue 2 years ago • 3 comments

Describe the bug

你好,我现在正在研究这个包的用法,但是我发现配置了bumpp.config.ts配置并不生效,然后我看了下源代码 image 是不是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.

SenRanYo avatar Apr 14 '23 01:04 SenRanYo

Seems like it should be name: "bumpp" or the docs should be changed: https://github.com/antfu/bumpp/blame/main/README.md#L17

aleclarson avatar Apr 17 '23 19:04 aleclarson

确实,调试半天发现名字不对……

yunsii avatar Jul 22 '23 12:07 yunsii

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
  • commit and tag are ignored if set to false or if seet to a string e.g. jumpy or ju-%s-py
  • it also actually tries to commit/tag/etc.

bumpp-v9.2.0-bumpp.config.ts

  • does not find bumpp.config.ts

chrisspiegl avatar Oct 18 '23 16:10 chrisspiegl

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)

Xnapper-2024-04-24-16 43 43

bump.config.ts (respects some of the config parameters)

Xnapper-2024-04-24-16 37 14

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.

chrisspiegl avatar Apr 24 '24 14:04 chrisspiegl