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

Let ya support .nu files #1947

Open
3 tasks done
zooeywm opened this issue Nov 25, 2024 · 6 comments
Open
3 tasks done

Let ya support .nu files #1947

zooeywm opened this issue Nov 25, 2024 · 6 comments
Labels
feature New feature request

Comments

@zooeywm
Copy link
Contributor

zooeywm commented Nov 25, 2024

yazi --debug output

❯ yazi --debug

Yazi
    Version: 0.3.3 (1277b017 2024-11-24)
    Debug  : false
    Triple : x86_64-unknown-linux-gnu (linux-x86_64)
    Rustc  : 1.82.0 (f6e511ee 2024-10-15)

Ya
    Version: 0.3.3 (1277b017 2024-11-24)

Emulator
    Emulator.via_env: ("xterm-256color", "WezTerm")
    Emulator.via_csi: Ok(WezTerm)
    Emulator.detect : WezTerm

Adapter
    Adapter.matches: Iip

Desktop
    XDG_SESSION_TYPE           : Some("wayland")
    WAYLAND_DISPLAY            : Some("wayland-1")
    DISPLAY                    : Some(":0")
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: Some("12f9a0d0b93f691d4d9923716557154d74777b0a_1732499023_1841097409")
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL           : Some("/usr/bin/zsh")
    EDITOR          : Some("lvim")
    VISUAL          : Some("lvim")
    YAZI_FILE_ONE   : None
    YAZI_CONFIG_HOME: None
    YAZI_ZOXIDE_OPTS: None
    FZF_DEFAULT_OPTS: Some("--ansi --height=100% --reverse --cycle")

Text Opener
    default     : Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block-create: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block-rename: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

Multiplexers
    TMUX               : false
    tmux version       : No such file or directory (os error 2)
    tmux build flags   : enable-sixel=Unknown
    ZELLIJ_SESSION_NAME: None
    Zellij version     : 0.41.2

Dependencies
    file          : 5.45
    ueberzugpp    : No such file or directory (os error 2)
    ffmpeg/ffprobe: ffmpeg version N-116914-g8a314e3f11 Copyright (c) 2000-2024 the FFmpeg developers / ffprobe version N-116914-g8a314e3f11 Copyright (c) 2007-2024 the FFmpeg developers
    pdftoppm      : 24.11.0
    magick        : 7.1.1-41
    fzf           : 0.56.3
    fd/fdfind     : 10.2.0 / No such file or directory (os error 2)
    rg            : 14.1.1
    chafa         : No such file or directory (os error 2)
    zoxide        : 0.9.6
    7z/7zz        : 17.05 / No such file or directory (os error 2)
    jq            : 1.7.1

Clipboard
    wl-copy/paste: 2.2.1 / 2.2.1
    xclip        : 0.13
    xsel         : No such file or directory (os error 2)

Please describe the problem you're trying to solve

Currently ya pack -i doesn't support .nu files, so the plugin like sudo.yazi, which depends on nushell will not work.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

I wonder is it a time to let ya pack support .nu files.

Additional context

No response

Validations

  • I have searched the existing issues/discussions
  • The latest nightly build doesn't already have this feature
@zooeywm zooeywm added the feature New feature request label Nov 25, 2024
@sxyazi
Copy link
Owner

sxyazi commented Nov 25, 2024

Any idea how to support that?

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Nov 25, 2024
@zooeywm
Copy link
Contributor Author

zooeywm commented Nov 26, 2024

Any idea how to support that?

Hello,

Thank you for the excellent work on yazi! From the deploy code, I noticed that currently, plugins only support files in ["init.lua", "README.md", "LICENSE"]. I think it would be great if this functionality could be extended further.

For instance, adding support for other file formats, such as .nu, via a configurable pattern (like a regex) would make yazi plugins more flexible for a variety of use cases. Alternatively, allowing all file formats by default could simplify things even further and enable broader plugin usage.

I understand there may be design considerations or reasons behind the current implementation, but I would appreciate your thoughts on expanding this capability. If there's a preferred approach to achieve this, I'd be happy to contribute.

@github-actions github-actions bot removed the waiting on op Waiting for more information from the original poster label Nov 26, 2024
@AnirudhG07
Copy link

AnirudhG07 commented Nov 26, 2024

Adding on to it, what if each plugin can optionally have a file, which will specify to add file X Y Z. so apart from the original 3, if anyone wants to make a Broader plugin without cramming everything in init.lua, that would be great. And for this issue, any .nu file, bash script or X Y Z.
For example file-actions.yazi contains pre-made action shell scripts, which needs to be manually added. That can be easily added together with ya pack -a author/plugin. What do you think?

@sxyazi
Copy link
Owner

sxyazi commented Nov 26, 2024

I want to avoid using a file list as much as possible because it makes the update/uninstall process more complicated. Updating or uninstalling requires cleaning up the files that are already installed. If there’s a file list, which might change over time, it means you would need to compare the file list of the current version with that of the updated version. From my experience, this easily leads to issues with inconsistent file states. For example, a failed installation can cause this, because we are chasing after a constantly changing target.

I think a simpler approach would be to introduce a new assets directory. If the user plugin includes this, we could simply copy it to install. The plugin author would need to ensure that the files inside are completely static (with no state information), so that when the user uninstalls the plugin, Yazi can simply delete it entirely.

@AnirudhG07
Copy link

Yeah that also makes sense. assets sounds good too

@zooeywm
Copy link
Contributor Author

zooeywm commented Nov 27, 2024

I think a simpler approach would be to introduce a new assets directory.

LGTM, I will give a shot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

No branches or pull requests

3 participants