mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-31 15:45:23 +00:00
feat: harden plugin api for separate repos, signed updates and generic external login
This commit is contained in:
1 parent
fb9c168b6b
commit
80944301dd
310 files changed
+6577
-4927
No files matched your search
@@ -43,6 +43,21 @@ const pluginBoundary = {
|
||||
ExportNamedDeclaration: (node) => check(node, node.source?.value),
|
||||
ExportAllDeclaration: (node) => check(node, node.source.value),
|
||||
ImportExpression: (node) => check(node, node.source.value),
|
||||
// vi.mock("@/x") and require("../../x") name a module too.
|
||||
CallExpression: (node) => {
|
||||
const callee = node.callee;
|
||||
const named =
|
||||
(callee.type === "Identifier" && callee.name === "require") ||
|
||||
(callee.type === "MemberExpression" &&
|
||||
callee.object.type === "Identifier" &&
|
||||
callee.object.name === "vi" &&
|
||||
callee.property.type === "Identifier" &&
|
||||
["mock", "doMock", "importActual", "unmock"].includes(
|
||||
callee.property.name,
|
||||
));
|
||||
const first = node.arguments[0];
|
||||
if (named && first?.type === "Literal") check(node, first.value);
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user