Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking issue for Paq 2.0 #149

Open
13 of 15 tasks
savq opened this issue Aug 3, 2023 · 9 comments
Open
13 of 15 tasks

Tracking issue for Paq 2.0 #149

savq opened this issue Aug 3, 2023 · 9 comments

Comments

@savq
Copy link
Owner

savq commented Aug 3, 2023

State management and reproducibility

Update code base

Release

  • Update the (very outdated) CHANGELOG.md
  • Create github release and tag commit
@savq savq changed the title Tracking issue: Paq 2.0 Tracking issue for Paq 2.0 Aug 3, 2023
@justinmk
Copy link
Contributor

justinmk commented Aug 3, 2023

fwiw, if/when Nvim includes a package manager I'm pretty convinced it will be based on paq because it's so small. Not sure the lockfile feature is needed though.

@saccarosium
Copy link
Collaborator

@justinmk do you have a better/more sensible solution?

The idea of the lockfile that represent the previous state seems a good idea, since would simplify a lot of the logic. Now is in a very primitive state but I think could become the foundation for better usability over the behavior that paq provide now.

@justinmk
Copy link
Contributor

justinmk commented Aug 4, 2023

The idea of the lockfile that represent the previous state seems a good idea, since would simplify a lot of the logic

If it simplifies the logic then it's good :) Probably https://github.com/neovim/packspec should define pkg.lock.json ...

@savq
Copy link
Owner Author

savq commented Aug 6, 2023

Probably https://github.com/neovim/packspec should define pkg.lock.json ...

Yes! If packages can define dependencies, there has to be a file that describes all the packages in the system. Otherwise it'll be hard for users to understand (let alone debug) their package setup.

@saccarosium
Copy link
Collaborator

saccarosium commented Aug 9, 2023

I was thinking that after 2.0 we could make install paq as a file into the lua directory in peoples config, like what plug does in the autoload folder. This would make paq a lot more portable and people would just have it in their dotfiles.

For installing we could have a script that curl paq and the documentation into the apropriate spot. And for updating we could provide a simple script that compares the two files and updates to the new one and re-pulls the docs down.

@saccarosium
Copy link
Collaborator

saccarosium commented Sep 13, 2023

@savq I've implemented all the state management feature in the todolist but I wanted to ask if you agree with some of my decision regarding how I've handled the different scenario:

  • branch changed: Paq will silently reinstall the plugin without the user knowing (see function reclone)
  • remote changed: same as branch
  • opt/start directory: Paq will move silently the plugins in the currect location

How it works

Paq at the when is called with the packages will confront the difference between the configuration and the lockfile (done with the diff_populate function) and will populate a table of pkgs called Diff of what is different with the following format:

Diff = {
  [name] = {
    -- ...pkg...
    status = {TO_MOVE|TO_RECLONE}
  }
}

On every command (clear, install, update and sync) Paq will check if there are diffs to be handled in Diff. This is done with the diff_resolve function.

After some testing I didn't found any major problems, but I think we should make a test suite for testing the edge cases.

@telemachus
Copy link

savq I've implemented all the state management feature in the todolist but I wanted to ask if you agree with some of my decision regarding how I've handled the different scenario:

  • branch changed: Paq will silently reinstall the plugin without the user knowing (see function reclone)
  • remote changed: same as branch
  • opt/start directory: Paq will move silently the plugins in the currect location

FWIW, as a user I agree with this design. If I've changed the branch, remote, or opt/start directory in my configuration, then I've asked for the changes. I shouldn't need extra confirmation.

@savq
Copy link
Owner Author

savq commented Sep 21, 2023

  • branch changed: Paq will silently reinstall the plugin without the user knowing (see function reclone)
  • remote changed: same as branch

That's is fine for now.

I believe there's a command that could work here, But I haven't tried it yet:

git switch --force-create <branch> --track <remote>/<branch>
  • opt/start directory: Paq will move silently the plugins in the currect location

Yes. This should be the default. As telemachus said, if the user changed their config, then there's no need for confirmation.

On every command (clear, install, update and sync) Paq will check if there are diffs to be handled in Diff.

I don't think this should be done on :PaqClean.

Everything else on dev looks good!

@saccarosium
Copy link
Collaborator

I believe there's a command that could work here, But I haven't tried it yet:

git switch --force-create <branch> --track <remote>/<branch>

Seem interesting I should take a look on that

I don't think this should be done on :PaqClean.

As is for now we don't have a choice since if the diff is not resolved PaqClean will delete the package, since it think is an unlisted package.

ErwinJanssen added a commit to ErwinJanssen/dotfiles that referenced this issue Oct 18, 2023
Why another plugin manager?

- The intention was to migrate all plugin management to Packer. This
  effort was not yet done, some plugins are still installed with
  vim-plug.
- Packer is no longer maintained, so migrating everything to this no
  longer makes sense.
- Hence, another (Lua) plugin manager is required.

Why Paq:

- Paq is small and focused. It provides package management only, it
  doesn't try to be a full-on configuration framework.
- If Neovim will ever have a built-in package manager, it will probably
  be based on paq:
  savq/paq-nvim#149 (comment)
- The main alternative at the moment is lazy.nvim:
  https://github.com/folke/lazy.nvim
    - This one is really popular these days, the auther of Packer also
      moved to this plugin manager.
    - It tries to do a lot, including configuration management, and is
      very opniated.
    - lazy.nvim takes over all the plugin loading, overriding the
      default Neovim behavior, and making it impossible to use it
      besides other package manager. This makes migration difficult.
    - When I first tried it, it gave a lot of errors and I couldn't get
      it to work
- Initial tests with Paq "just worked". It is easy to use, and doesn't
  get in your way.

Maybe the simplicity and lack of popularity will become problematic at
some point, but so far it's good.
ErwinJanssen added a commit to ErwinJanssen/dotfiles that referenced this issue Oct 18, 2023
Why another plugin manager?

- The intention was to migrate all plugin management to Packer. This
  effort was not yet done, some plugins are still installed with
  vim-plug.
- Packer is no longer maintained, so migrating everything to this no
  longer makes sense.
- Hence, another (Lua) plugin manager is required.

Why Paq:

- Paq is small and focused. It provides package management only, it
  doesn't try to be a full-on configuration framework.
- If Neovim will ever have a built-in package manager, it will probably
  be based on paq:
  savq/paq-nvim#149 (comment)
- The main alternative at the moment is lazy.nvim:
  https://github.com/folke/lazy.nvim
    - This one is really popular these days, the auther of Packer also
      moved to this plugin manager.
    - It tries to do a lot, including configuration management, and is
      very opniated.
    - lazy.nvim takes over all the plugin loading, overriding the
      default Neovim behavior, and making it impossible to use it
      besides other package manager. This makes migration difficult.
    - When I first tried it, it gave a lot of errors and I couldn't get
      it to work
- Initial tests with Paq "just worked". It is easy to use, and doesn't
  get in your way.

Maybe the simplicity and lack of popularity will become problematic at
some point, but so far it's good.
ErwinJanssen added a commit to ErwinJanssen/dotfiles that referenced this issue Oct 18, 2023
Why another plugin manager?

- The intention was to migrate all plugin management to Packer. This
  effort was not yet done, some plugins are still installed with
  vim-plug.
- Packer is no longer maintained, so migrating everything to this no
  longer makes sense.
- Hence, another (Lua) plugin manager is required.

Why Paq:

- Paq is small and focused. It provides package management only, it
  doesn't try to be a full-on configuration framework.
- If Neovim will ever have a built-in package manager, it will probably
  be based on paq:
  savq/paq-nvim#149 (comment)
- The main alternative at the moment is lazy.nvim:
  https://github.com/folke/lazy.nvim
    - This one is really popular these days, the auther of Packer also
      moved to this plugin manager.
    - It tries to do a lot, including configuration management, and is
      very opniated.
    - lazy.nvim takes over all the plugin loading, overriding the
      default Neovim behavior, and making it impossible to use it
      besides other package manager. This makes migration difficult.
    - When I first tried it, it gave a lot of errors and I couldn't get
      it to work
- Initial tests with Paq "just worked". It is easy to use, and doesn't
  get in your way.

Maybe the simplicity and lack of popularity will become problematic at
some point, but so far it's good.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants