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);
});
});