Added plugin testing suite

This commit is contained in:
nicwands
2026-02-27 13:03:19 -05:00
parent 3c8b896073
commit fb62c356d8
5 changed files with 1047 additions and 7 deletions

1041
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
{ {
"name": "takerofnotes-plugin-sdk", "name": "@takerofnotes/plugin-sdk",
"version": "0.1.0", "version": "0.1.0",
"description": "SDK to create a storage plugin for Taker of Notes", "description": "SDK to create a storage plugin for Taker of Notes",
"type": "module", "type": "module",
@@ -21,13 +21,15 @@
"scripts": { "scripts": {
"build": "tsup src/index.ts --format esm --dts", "build": "tsup src/index.ts --format esm --dts",
"dev": "tsup src/index.ts --format esm --dts --watch", "dev": "tsup src/index.ts --format esm --dts --watch",
"test": "vitest",
"prepublishOnly": "npm run build" "prepublishOnly": "npm run build"
}, },
"author": "nicwands", "author": "nicwands",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"tsup": "^8.5.1", "tsup": "^8.5.1",
"typescript": "^5.9.3" "typescript": "^5.9.3",
"vitest": "^3.2.4"
}, },
"dependencies": { "dependencies": {
"zod": "^4.3.6" "zod": "^4.3.6"

View File

@@ -1,4 +1,6 @@
export { BaseNotesAdapter } from './BaseNotesAdapter' export { BaseNotesAdapter } from './BaseNotesAdapter'
export { definePlugin } from './definePlugin' export { definePlugin } from './definePlugin'
export { validatePlugin, SUPPORTED_API_VERSION } from './validatePlugin' export { validatePlugin, SUPPORTED_API_VERSION } from './validatePlugin'
export { runPluginTests, createTestNote } from './testPlugin'
export type { NotesPlugin, ConfigField } from './types' export type { NotesPlugin, ConfigField } from './types'
export type { TestNote, TestPluginOptions } from './testPlugin'

View File

@@ -15,3 +15,5 @@ export interface NotesPlugin {
configSchema: ConfigField[] configSchema: ConfigField[]
createAdapter(config: any): any createAdapter(config: any): any
} }
export type { BaseNotesAdapter } from './BaseNotesAdapter'

View File

@@ -7,7 +7,8 @@
"strict": true, "strict": true,
"moduleResolution": "Node", "moduleResolution": "Node",
"esModuleInterop": true, "esModuleInterop": true,
"skipLibCheck": true "skipLibCheck": true,
"types": ["vitest/globals"]
}, },
"include": ["src"] "include": ["src"]
} }