mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 06:05:24 +00:00
chore: move plugins to their own repos and drop the plugins folder
This commit is contained in:
1 parent
29a946d02e
commit
e02b5fe6e4
3167 files changed
+286
-440749
No files matched your search
@@ -24,13 +24,8 @@ function fixture() {
|
||||
path.join(root, "node_modules"),
|
||||
"dir",
|
||||
);
|
||||
fs.mkdirSync(path.join(root, "scripts"));
|
||||
fs.copyFileSync(
|
||||
path.join(repo, "scripts/apply-plugin-patches.cjs"),
|
||||
path.join(root, "scripts/apply-plugin-patches.cjs"),
|
||||
);
|
||||
const plugin = path.join(root, "plugins/fixture");
|
||||
fs.mkdirSync(path.join(plugin, "patches"), { recursive: true });
|
||||
const plugin = path.join(root, "fixture");
|
||||
fs.mkdirSync(plugin);
|
||||
fs.writeFileSync(
|
||||
path.join(plugin, "manifest.json"),
|
||||
JSON.stringify({ id: "fixture" }),
|
||||
@@ -39,10 +34,6 @@ function fixture() {
|
||||
path.join(plugin, "package.json"),
|
||||
JSON.stringify({ name: "fixture" }),
|
||||
);
|
||||
fs.writeFileSync(
|
||||
path.join(plugin, "patches/check.cjs"),
|
||||
'require("node:fs").writeFileSync("patched", "ok");',
|
||||
);
|
||||
const run = (...args: string[]) =>
|
||||
spawnSync(process.execPath, args, { cwd: plugin, encoding: "utf8" });
|
||||
return {
|
||||
@@ -54,15 +45,6 @@ function fixture() {
|
||||
}
|
||||
|
||||
describe("plugin CLI before the SDK is built", () => {
|
||||
it("runs the postinstall plugin patches without SDK dist files", () => {
|
||||
const { root, plugin, run } = fixture();
|
||||
expect(fs.existsSync(path.join(root, "packages/plugin-sdk/dist"))).toBe(
|
||||
false,
|
||||
);
|
||||
const result = run(path.join(root, "scripts/apply-plugin-patches.cjs"));
|
||||
expect(result.status, result.stderr).toBe(0);
|
||||
expect(fs.readFileSync(path.join(plugin, "patched"), "utf8")).toBe("ok");
|
||||
});
|
||||
it("prints help without SDK dist files", () => {
|
||||
const { cli, run } = fixture();
|
||||
const result = run(cli, "--help");
|
||||
|
||||
Reference in new issue
Block a user