-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Feature: PluginFS API #71
Comments
We have added a sync-blocking |
There's a way to isolate the PluginFS for scoped plugin folder. First remove the global class PluginFS {
constructor(name) { }
read(path) { /*do path check*/ }
// ...
} Pass an instance for each plugin init call. function loadPlugin(name) {
// ...
ctx.fs = new PluginFS(name)
// ...
} export function init(ctx) {
ctx.read('some/path/to/file')
} Important With top-level JS files (aka single file plugins), they should not access |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Community devs often need to access the file system to complete certain operations, such as opening a folder for users to add or delete files, outputting logs to a file, and so on.
So a PluginFS API is needed, and it should be plugin scoped meaning that a plugin only have permission on it's own folder.
In this case top-level js will not have any permission because it don't have its own folder.
Actually I've done some job on that using
std::filesystem
from C++17, so I think if is ok we can move to C++17 to gain more convenience and improved cross-platform compatibility.The text was updated successfully, but these errors were encountered: