From 906dfa7c347ca0402433261f9d40b853159fcf69 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Thu, 7 Oct 2021 18:29:59 +0300 Subject: [PATCH] add schemas for repos and plugins --- .npmignore | 3 ++- package.json | 1 + schema/plugin.schema.json | 47 +++++++++++++++++++++++++++++++++++ schema/repository.schema.json | 38 ++++++++++++++++++++++++++++ src/index.ts | 7 ++++++ 5 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 schema/plugin.schema.json create mode 100644 schema/repository.schema.json diff --git a/.npmignore b/.npmignore index 745c5b9..6133f5f 100644 --- a/.npmignore +++ b/.npmignore @@ -1,3 +1,4 @@ /src/ +/schema/ /tsconfig.json -/tslint.json \ No newline at end of file +/tslint.json diff --git a/package.json b/package.json index d72a663..7c9ffaf 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "3.3.4", "description": "Squeebot v3 core for the execution environment", "main": "lib/index.js", + "types": "lib/index.d.ts", "module": "lib/", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", diff --git a/schema/plugin.schema.json b/schema/plugin.schema.json new file mode 100644 index 0000000..7eb3d5d --- /dev/null +++ b/schema/plugin.schema.json @@ -0,0 +1,47 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://squeebot.lunasqu.ee/pkg/plugin.schema.json", + "title": "plugin", + "description": "Squeebot plugin definition", + "type": "object", + "properties": { + "main": { + "type": "string", + "description": "Plugin's entry file, must export a class that extends Plugin" + }, + "name": { + "type": "string", + "description": "Name of the plugin" + }, + "description": { + "type": "string", + "description": "A short description of the plugin's functions" + }, + "tags": { + "type": "array", + "description": "A list of descriptive tags", + "items": { + "type": "string" + } + }, + "version": { + "type": "string", + "description": "Semantic version(ing)" + }, + "dependencies": { + "type": "array", + "description": "A list of plugin dependencies. ? suffix denotes optional.", + "items": { + "type": "string" + } + }, + "npmDependencies": { + "type": "array", + "description": "A list of NPM dependencies, package@version format", + "items": { + "type": "string" + } + } + }, + "required": ["main", "name", "version"] +} diff --git a/schema/repository.schema.json b/schema/repository.schema.json new file mode 100644 index 0000000..64eb348 --- /dev/null +++ b/schema/repository.schema.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://squeebot.lunasqu.ee/pkg/repository.schema.json", + "title": "repository", + "description": "Squeebot repository definition", + "type": "object", + "properties": { + "created": { + "type": "integer", + "description": "When was the repository last built" + }, + "name": { + "type": "string", + "description": "Name of the repository" + }, + "plugins": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the plugin" + }, + "version": { + "type": "string", + "description": "Plugin version" + } + } + } + }, + "typescript": { + "type": "boolean", + "description": "Is TypeScript enabled?" + } + }, + "required": ["name", "plugins"] +} diff --git a/src/index.ts b/src/index.ts index e69de29..71396d2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -0,0 +1,7 @@ +export * from './channel'; +export * from './common'; +export * from './core'; +export * from './npm'; +export * from './plugin'; +export * from './types'; +export * from './util';