Notify of plugin updates and add update UX (#339)

This commit is contained in:
Gregory Schier
2026-01-02 10:03:08 -08:00
committed by GitHub
parent e751167dfc
commit 0146ee586f
20 changed files with 375 additions and 103 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "@yaak/faker",
"private": true,
"version": "0.1.0",
"version": "1.1.1",
"displayName": "Faker",
"description": "Template functions for generating fake data using FakerJS",
"repository": {
@@ -11,7 +11,8 @@
},
"scripts": {
"build": "yaakcli build",
"dev": "yaakcli dev"
"dev": "yaakcli dev",
"test": "vitest --run tests"
},
"dependencies": {
"@faker-js/faker": "^10.1.0"

View File

@@ -1 +0,0 @@
declare module '@faker-js/faker';

View File

@@ -65,7 +65,7 @@ export const plugin: PluginDefinition = {
name: ['faker', modName, fnName].join('.'),
args: args(modName, fnName),
async onRender(_ctx, args) {
const fn = mod[fnName] as (...a: unknown[]) => unknown;
const fn = mod[fnName as keyof typeof mod] as (...a: unknown[]) => unknown;
const options = args.values.options;
// No options supplied

View File

@@ -0,0 +1,9 @@
import { describe, expect, it } from 'vitest';
describe('formatDatetime', () => {
it('returns formatted current date', async () => {
// Ensure the plugin imports properly
const faker = await import('../src/index');
expect(faker.plugin.templateFunctions?.length).toBe(226);
});
});

View File

@@ -1,7 +1,7 @@
{
"name": "@yaak/mcp-server",
"private": true,
"version": "0.1.4",
"version": "0.1.7",
"displayName": "MCP Server",
"description": "Expose Yaak functionality via Model Context Protocol",
"minYaakVersion": "2025.10.0-beta.6",

View File

@@ -10,8 +10,18 @@ export const plugin: PluginDefinition = {
// Start the server after waiting, so there's an active window open to do things
// like show the startup toast.
console.log('Initializing MCP Server plugin');
setTimeout(() => {
mcpServer = createMcpServer({ yaak: ctx }, serverPort);
setTimeout(async () => {
try {
mcpServer = createMcpServer({ yaak: ctx }, serverPort);
} catch (err) {
console.error('Failed to start MCP server:', err);
ctx.toast.show({
message: `Failed to start MCP Server: ${err instanceof Error ? err.message : String(err)}`,
icon: 'alert_triangle',
color: 'danger',
timeout: 10000,
});
}
}, 5000);
},