The plugin compiler spawned esbuild through app.asar, and the subprocess imported the React client barrel. Point esbuild at the unpacked binary, add a react-free @paseo/plugin/server entry, and pass a typed PluginTheme so plugin UI follows the active theme on desktop and mobile.
32 lines
779 B
TypeScript
32 lines
779 B
TypeScript
import { defineAttachmentSource, defineRpc } from "@paseo/plugin/server";
|
|
import { z } from "zod";
|
|
|
|
const SearchPayloadSchema = z.object({
|
|
items: z.array(
|
|
z.object({
|
|
id: z.string(),
|
|
identifier: z.string(),
|
|
title: z.string(),
|
|
subtitle: z.string().optional(),
|
|
url: z.string().url(),
|
|
text: z.string(),
|
|
resourceType: z.string(),
|
|
}),
|
|
),
|
|
});
|
|
|
|
export const searchIssuesRpc = defineRpc({
|
|
name: "issues.search",
|
|
input: z.object({ query: z.string() }),
|
|
output: SearchPayloadSchema,
|
|
});
|
|
|
|
export const issueAttachments = defineAttachmentSource({
|
|
id: "issues",
|
|
title: "Linear issue",
|
|
icon: "CircleDot",
|
|
pickerTitle: "Attach Linear issue",
|
|
searchPlaceholder: "Search by identifier or title",
|
|
search: searchIssuesRpc,
|
|
});
|