-
Notifications
You must be signed in to change notification settings - Fork 39
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
Paq 2.0 #157
Conversation
Instead of having of having a separate key to evaluate if the directory is installed or not I've made the following changes to status enum: - INSTALLED: equivalent to the old exists key - LISTED: a package is in the paq list but it isn't yet been installed - CLONED: equivalent to what installed used to mean, a package was recently cloned (aka installed) on the machine. Also to simplify the filtering of packaging based on the status I've made a new table called 'filters' that help filter packages both in 'vim.tbl_filter' and regular if statements.
Instead of saving the state on the function 'exe_op' I save the state on every individual function that alter the state. I find this to be more reliable.
Public API: - Rename `run` option to `build`. - Rename `PaqRunHook` command to `PaqBuild`. Paq will print a deprecation notice if the old names are used. The reason for renaming these is explained in #143. Internals: - Refactor build related functions to ensure builds are executed after all packages have been installed/updated and loaded: - If the hook is a function, it might require a module inside a recently installed package. - If a is package is installed successfully and the build fails, it's better to notify that in two separate messages, instead of notifying the install failed. - Rename `run_hook` to `run_build`, and refactor to make it clear there's 3 possible cases: function, ex command, shell commmand. - Refactor `new_counter` to take a callback (passed in `exe_op`).
- Refactor `report` and `counter` to have (almost) the same signature. - Refactor the weird logic used to handle `PaqSync` messages.
Since sync needs a reference to self, it must be called with the ':'. This makes it impossible to reference it in a table.
When a branch or a remote is changed, Paq will remove the old plugin and reinstall the new one with the appropriate changes. I've opted for this solution because there are too many variables when dealing with git, so easiest solution is just to reinstall the plugin.
Now we have a clear distinction between the `Lock` and `Diff` table. Now they both have their own set of functions to deal specifically with them. For example all function that mutates `Lock` are prefixed with `lock_*`.
Now the file is categorize in 'sections' by using 'foldmethod=marker'.
Yeah, fortunately the public API is rather small. I'd really like for Paq to be one file, but not even vim-plug embeds the docs. I don't think this is blocking, and I'll move the doc ideas out of the tracking issue. |
Hi @savq, |
Pretty happy with the result. I think we are ready to ship it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I finished checking all the changes.
I think there's only a tiny change needed, otherwise we're good to go!
Thank you @saccarosium for all the work you've done. I don't think there's any more breaking changes or big changes to make, so we can continue working on smaller stuff in separate PRs. |
BREAKING CHANGES:
run
option is deprecated. Usebuild
instead.PaqRunHook
is deprecated in favor ofPaqBuild
.paq
/register
function was removed.I think we are ready to ship paq 2.0. We need to made some small modifications but I think we are there.
I have some questions regarding the documentation. If we are gonna annotate the source with emmylua comment, what documentation generator we'll going to use? mini.doc or lemmy-help?
When I've tried do documentation with emmylua comments, I found myself unwrapping a lot of the code since parsers didn't play nicely with things such as metatables. Also is worth noting that most of the documentation, found in the
paq-nvim.txt
, doesn't really belong anywhere in the codebase. Leading to having pretty big wall of comments at the begin and end of the file and nothing in the middle.PaqSync
doesn't re-install plugins whenbranch
is changed #80