mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-11 22:40:26 +01:00
Notify of plugin updates and add update UX (#339)
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
declare module '@faker-js/faker';
|
||||
@@ -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
|
||||
|
||||
9
plugins-external/faker/tests/init.test.ts
Normal file
9
plugins-external/faker/tests/init.test.ts
Normal 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);
|
||||
});
|
||||
});
|
||||
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user