Let a plugin carry its own package.json and npm dependencies #75
Reference in New Issue
Block a user
Delete Branch "plugin-dependencies"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A plugin folder may now hold its own
package.json, lockfile andnode_modules. Installing a plugin is still just getting its folder to/app/plugins/<id>; nothing about its dependencies touches the host's.The author barrel ships as the
@plainpages/plugin-apipackage, linked into/node_modulesabove every plugin scope, replacing the#plugin-apisubpath import — a subpath import resolves against the nearestpackage.json, so it could not survive a plugin owning one. The link keeps it a single instance, whichinstanceof GuardErroracross a plugin boundary depends on.Discovery refuses a plugin whose
package.jsonomits"type": "module"(npm writes none, and the CommonJS default breaks a .js helper and re-parses every .ts), and no longer treats a strayplugins/node_modulesas a plugin.