mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-23 17:52:49 +00:00
* feat(plugins): enable registry installs by default * fix(plugins): explain explicit Git source for missing registry IDs * fix(plugins): tailor missing registry guidance to installation * test(app): sample footer geometry in one browser frame * fix(plugins): make registry source resolution deterministic Directory existence must not change the meaning of a registry identifier shared by CLI, RPC, and UI installs. Classify explicit host paths in the source parser and explain recovery from registry transport and revision-selection failures. * fix(plugins): recognize dot and Windows directory sources * test(cli): wait for readable daemon ownership before cancellation The cancellation test raced PID-file creation against its first write and parsed empty JSON in CI. Use the public daemon-instance reader to wait for and capture the supervisor PID before asserting cancellation cleanup. * test(app): expect missing directory install guidance
92 lines
3.3 KiB
TypeScript
92 lines
3.3 KiB
TypeScript
import { parsePluginRegistryReference } from "./plugin-registry.js";
|
|
import { describe, expect, it } from "vitest";
|
|
import { parsePluginSourceReference } from "./plugin-source-reference.js";
|
|
|
|
describe("plugin source references", () => {
|
|
it.each([
|
|
".",
|
|
"..",
|
|
"./owner/slug",
|
|
"../owner/slug",
|
|
"/owner/slug",
|
|
"~/owner/slug",
|
|
"~",
|
|
"C:\\",
|
|
"C:/",
|
|
"D:\\plugins\\repository",
|
|
"D:/plugins/repository",
|
|
"\\\\server\\share",
|
|
"\\\\server\\share\\plugins\\review",
|
|
".\\plugins\\review",
|
|
"..\\plugins\\review",
|
|
])("recognizes the explicit directory %s by shape", (source) => {
|
|
expect(parsePluginSourceReference(source)).toEqual({
|
|
kind: "directory",
|
|
source,
|
|
pluginPath: undefined,
|
|
});
|
|
expect(parsePluginSourceReference(`${source}:plugins/review`)).toEqual({
|
|
kind: "directory",
|
|
source,
|
|
pluginPath: "plugins/review",
|
|
});
|
|
});
|
|
|
|
it.each([
|
|
["npm:review@1.2.0:nested", "npm:review@1.2.0", "nested"],
|
|
["npm:review@^1.2.0", "npm:review@^1.2.0", undefined],
|
|
["npm:@team/review@next:plugins/main", "npm:@team/review@next", "plugins/main"],
|
|
["github:owner/repository", "github:owner/repository", undefined],
|
|
[
|
|
"git:git@example.test:owner/repository.git",
|
|
"git:git@example.test:owner/repository.git",
|
|
undefined,
|
|
],
|
|
["git:file:///repo:plugins/main", "git:file:///repo", "plugins/main"],
|
|
["plugins.example.com:8443/owner/slug", "plugins.example.com:8443/owner/slug", undefined],
|
|
["owner/repository", "owner/repository", undefined],
|
|
["plugins/foo", "plugins/foo", undefined],
|
|
["owner/repository:plugins/review", "owner/repository", "plugins/review"],
|
|
[
|
|
"https://example.test:8443/owner/repository.git",
|
|
"https://example.test:8443/owner/repository.git",
|
|
undefined,
|
|
],
|
|
[
|
|
"https://example.test:8443/owner/repository.git:plugins/review",
|
|
"https://example.test:8443/owner/repository.git",
|
|
"plugins/review",
|
|
],
|
|
["git@example.test:owner/repository.git", "git@example.test:owner/repository.git", undefined],
|
|
[
|
|
"git@example.test:owner/repository.git:plugins/review",
|
|
"git@example.test:owner/repository.git",
|
|
"plugins/review",
|
|
],
|
|
["file:///D:/plugins/repository", "file:///D:/plugins/repository", undefined],
|
|
[
|
|
"file:///D:/plugins/repository:plugins/review",
|
|
"file:///D:/plugins/repository",
|
|
"plugins/review",
|
|
],
|
|
])("parses %s", (reference, source, pluginPath) => {
|
|
expect(parsePluginSourceReference(reference)).toEqual({ kind: "managed", source, pluginPath });
|
|
});
|
|
});
|
|
|
|
it("addresses default and private registries without treating explicit sources as registry IDs", () => {
|
|
expect(parsePluginRegistryReference("omercnet/dracula")).toEqual({
|
|
url: "https://plugins.paseo.sh",
|
|
id: "omercnet/dracula",
|
|
});
|
|
expect(parsePluginRegistryReference("acme/plugin", "https://internal.example/registry/")).toEqual(
|
|
{ url: "https://internal.example/registry", id: "acme/plugin" },
|
|
);
|
|
expect(parsePluginRegistryReference("internal.example:8443/acme/plugin")).toEqual({
|
|
url: "https://internal.example:8443",
|
|
id: "acme/plugin",
|
|
});
|
|
expect(parsePluginRegistryReference("github:acme/plugin")).toBeNull();
|
|
expect(parsePluginRegistryReference("npm:@acme/plugin")).toBeNull();
|
|
});
|