Open Allow2CEO opened 3 years ago
What was the error message/stacktrace you were getting?
IIRC, the plugin uses pacote (used by npm) underneath to load the packages. I guess it assumes that everything is valid.
Ah, maybe a couple of basic pre-checks then. npm is more a developer-side tool, the end user won't know that a spurious folder or corrupted package.json is causing your app to crash.
The error is easy to reproduce, put a blank folder in plugins folder, or modify a package.json to be invalid.
Nice library by the way. Using it to make our parental freedom automation app extensible.
I think I can do something to improve here. But can you please help me with what other functions fail?
Sure, simple improvement here and I'll post other issues as I come across them. Thanks!
Probably need some extra checks in the code.
I had a .idea folder in the plugins directory and also had a test plugin in there that had a syntax error in the package.json (missing key quotes, duh!)
Anyway, the epm.list function (and maybe others) should probably just reject (or log) any non-compliant plugin folders. Such as if package.json is missing or cannot be JSON parsed.