vuki656/package-info.nvim

[BUG] Changing the package version prepends ^ (caret) to the version

jakubreron opened this issue · 1 comments

Issues

  • I have checked existing issues and there are no issues with the same problem.

Plugin Version

  • I am using the latest version of the plugin

Neovim Version

  • I am using the 0.6 neovim version or later

Neovim Version

NVIM v0.10.0

Branch

master

Actual behavior

I have for example a package, without ^ in the version:
"my-package": "1.41.0",

After I run require('package-info').change_version(), and select other version, for example: 1.42.0, it automatically appends ^ to that version

So my package becomes this: "my-package": "^1.42.0",

Expected behavior

If the package:
"my-package": "1.41.0",
had version without ^ specified

Then, we shouldn't append ^ to the changed version as well
It should result in "my-package": "1.42.0", not in "my-package": "^1.42.0",

Steps to reproduce

  1. Get any package without ^ in the version
  2. Run require('package-info').change_version()
  3. See ^ prepended to the version

Package info config

{
   'vuki656/package-info.nvim', -- check if the package info is up to date
   lazy = true,
   dependencies = 'MunifTanjim/nui.nvim',
   event = 'BufWinEnter package.json',
   config = true,
 },

Other information

No response

Help

No, sorry.

Implementation help

No response

This is done by the package manager itself not the plugin. When you run the command, the plugin calls for example yarn update react in the background. Plugin doesn't parse the output or change the versions itself in any way.