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

Enhancements to Acode Plugin installer #1026

Open
alMukaafih opened this issue Sep 4, 2024 · 20 comments
Open

Enhancements to Acode Plugin installer #1026

alMukaafih opened this issue Sep 4, 2024 · 20 comments
Labels
enhancement New feature or request

Comments

@alMukaafih
Copy link
Contributor

Is it possible to add support for plugin dependencies?

@bajrangCoder
Copy link
Collaborator

Clearly explain it in detail

@bajrangCoder bajrangCoder added bug Something isn't working needs info / awaiting response and removed bug Something isn't working labels Sep 6, 2024
@alMukaafih
Copy link
Contributor Author

Like an array of plugins in plugin.json to be Installed along with the plugin. Maybe something like

{
  "dependencies": [
    "bajrangcoder.acodex", "sebastianjnuwu.acode.eruda"
  ]
}

@alMukaafih
Copy link
Contributor Author

I am willing to assist in implementing this

@bajrangCoder bajrangCoder added plugin api It represents, plugins specific apis enhancement and removed needs info / awaiting response labels Sep 6, 2024
@bajrangCoder
Copy link
Collaborator

Like an array of plugins in plugin.json to be Installed along with the plugin. Maybe something like

{
  "dependencies": [
    "bajrangcoder.acodex", "sebastianjnuwu.acode.eruda"
  ]
}

Ok

@bajrangCoder bajrangCoder added the todo Added to to-do list. label Sep 6, 2024
@bajrangCoder
Copy link
Collaborator

I am willing to assist in implementing this

Contributions are welcomed ☺️, feel free to open pr

@sebastianjnuwu
Copy link
Contributor

sebastianjnuwu commented Sep 7, 2024

I am willing to assist in implementing this

Contributions are welcomed ☺️, feel free to open pr

I had already talked about this, the system is similar to that of vscode, the .acode folder has the settings and dependencies and acode recognizes itself when the project folder is open if not with the default

I tried to do it, but I had some problems regarding recognizing the file and downloading the plugins. The paid plugins gave an error when downloading since they have a different API logic.

@alMukaafih alMukaafih changed the title Support for Plugin Dependencies Enhancements to Acode Plugin installer Oct 14, 2024
@alMukaafih
Copy link
Contributor Author

Currently when updating Plugins the installer does not delete the previous installation of the plugin rather it installs the update over the current installation. There is a problem of redundant files.
Suppose this is the current installation

.
├── assets
│   ├── 0.svg
│   ├── 1.svg
│   └── 2.svg
├── icon.png
├── main.js
├── plugin.json
└── readme.md

and this is the update

.
├── assets
│   ├── 3.svg
│   ├── 4.svg
│   └── 5.svg
├── icon.png
├── main.js
├── plugin.json
└── readme.md

after updating this will be the current installation

.
├── assets
│   ├── 0.svg
│   ├── 1.svg
│   ├── 2.svg
│   ├── 3.svg
│   ├── 4.svg
│   └── 5.svg
├── icon.png
├── main.js
├── plugin.json
└── readme.md

@alMukaafih
Copy link
Contributor Author

I suggest using a combination of id and version as the plugin folder name

`${plugin.id}-${plugin.version}`

instead of just id

@bajrangCoder
Copy link
Collaborator

Nice, I haven't noticed this.

I suggest using a combination of id and version as the plugin folder name

I think it will be good to remove the previous folder and then add the new update one , as the the id and version combination will make different instances of same plugin.

If you have any better idea then please share

@alMukaafih
Copy link
Contributor Author

Nice, I haven't noticed this.

I suggest using a combination of id and version as the plugin folder name

I think it will be good to remove the previous folder and then add the new update one , as the the id and version combination will make different instances of same plugin.

If you have any better idea then please share

Removing the previous folder and then installing the update will introduce some latency when updating a plugin, while this might go unnoticed for plugins with few files for plugins with close to a thousand files it will be noticed. We can keep a mapping of plugin IDs to their folders.

@bajrangCoder
Copy link
Collaborator

bajrangCoder commented Oct 14, 2024

Actually that latency will be visible in other approaches too.
I found a new way: "Checksum-Based Update (Detect Changes Before Overwriting)" this will only call few fs calls based on update (which will be efficient)

@alMukaafih
Copy link
Contributor Author

What about obsolete files? How do we detect them?

@bajrangCoder
Copy link
Collaborator

We can detect it:
By comparing the files present in the current plugin installation with the files in the update package. If any file exists in the current installation but does not exist in the update package, it is considered obsolete and can be safely deleted.

@alMukaafih
Copy link
Contributor Author

We can detect it: By comparing the files present in the current plugin installation with the files in the update package. If any file exists in the current installation but does not exist in the update package, it is considered obsolete and can be safely deleted.

Yes this is better, because some plugins assume the plugin folder to be it's id

@alMukaafih
Copy link
Contributor Author

I will begin working to implement this

@bajrangCoder bajrangCoder added enhancement New feature or request and removed todo Added to to-do list. plugin api It represents, plugins specific apis enhancement labels Nov 2, 2024
@alMukaafih
Copy link
Contributor Author

Currently Acode ignores the following fields in the plugin manifest file and uses static values instead

  • main.js in place of main
  • icon.png in place of icon
  • readme.md in place of readme
    Setting the value of any of the fields to a value other than the static values results in an error.

@bajrangCoder
Copy link
Collaborator

Currently Acode ignores the following fields in the plugin manifest file and uses static values instead

  • main.js in place of main
  • icon.png in place of icon
  • readme.md in place of readme
    Setting the value of any of the fields to a value other than the static values results in an error.

Yes, I planned to fix it but I forgot

@alMukaafih
Copy link
Contributor Author

I can help in implementing the fixes

1 similar comment
@alMukaafih
Copy link
Contributor Author

I can help in implementing the fixes

@bajrangCoder
Copy link
Collaborator

I can help in implementing the fixes

Open a pr

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

No branches or pull requests

3 participants