From ec1717d62d383dbc6bd7fed332fc85ef8020644f Mon Sep 17 00:00:00 2001 From: joe-allen-89 <85872286+joe-allen-89@users.noreply.github.com> Date: Tue, 1 Nov 2022 14:16:37 +0000 Subject: [PATCH] Initial commit --- README.md | 2 ++ adapt-authoring.json | 2 ++ conf/config.schema.json | 11 +++++++++++ docs/template-doc.md | 2 ++ index.js | 1 + lang/en.json | 3 +++ lib/TemplateModule.js | 8 ++++++++ package.json | 13 +++++++++++++ schema/template.schema.json | 18 ++++++++++++++++++ tests/ModuleTemplate.spec.js | 13 +++++++++++++ 10 files changed, 73 insertions(+) create mode 100644 README.md create mode 100644 adapt-authoring.json create mode 100644 conf/config.schema.json create mode 100644 docs/template-doc.md create mode 100644 index.js create mode 100644 lang/en.json create mode 100644 lib/TemplateModule.js create mode 100644 package.json create mode 100644 schema/template.schema.json create mode 100644 tests/ModuleTemplate.spec.js diff --git a/README.md b/README.md new file mode 100644 index 0000000..b85b158 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# adapt-authoring-templatemodule +This is a template Adapt authoring module. Feel free to use this as a base for creating your own authoring tool modules! \ No newline at end of file diff --git a/adapt-authoring.json b/adapt-authoring.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/adapt-authoring.json @@ -0,0 +1,2 @@ +{ +} diff --git a/conf/config.schema.json b/conf/config.schema.json new file mode 100644 index 0000000..886fcdd --- /dev/null +++ b/conf/config.schema.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "isTemplate": { + "description": "Whether this module is a template", + "type": "boolean", + "default": true + } + } +} diff --git a/docs/template-doc.md b/docs/template-doc.md new file mode 100644 index 0000000..6b97f80 --- /dev/null +++ b/docs/template-doc.md @@ -0,0 +1,2 @@ +# Template +This is a template documentation page that will be included in the developer guides when built using the `adapt-authoring-docs module`. diff --git a/index.js b/index.js new file mode 100644 index 0000000..834dbc4 --- /dev/null +++ b/index.js @@ -0,0 +1 @@ +export { default } from './lib/TemplateModule.js'; diff --git a/lang/en.json b/lang/en.json new file mode 100644 index 0000000..215e323 --- /dev/null +++ b/lang/en.json @@ -0,0 +1,3 @@ +{ + "error.templateerror": "Template error message!" +} diff --git a/lib/TemplateModule.js b/lib/TemplateModule.js new file mode 100644 index 0000000..714ea82 --- /dev/null +++ b/lib/TemplateModule.js @@ -0,0 +1,8 @@ +import { AbstractModule } from 'adapt-authoring-core'; + +export default class TemplateModule extends AbstractModule { + /** @override */ + async init() { + // do custom initialisation here + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..8745bda --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "name": "adapt-authoring-templatemodule", + "version": "0.0.1", + "description": "A template module for the Adapt authoring tool", + "homepage": "https://github.com/adapt-security/adapt-authoring-templatemodule", + "license": "GPL-3.0", + "type": "module", + "main": "index.js", + "repository": "github:adapt-security/adapt-authoring-templatemodule", + "peerDependencies": { + "adapt-authoring-core": "github:adapt-security/adapt-authoring-core" + } +} diff --git a/schema/template.schema.json b/schema/template.schema.json new file mode 100644 index 0000000..7007fb3 --- /dev/null +++ b/schema/template.schema.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$anchor": "template", + "description": "Just a template", + "type": "object", + "properties": { + "mandatoryField": { + "description": "This field is included in required, so is mandatory", + "type": "string" + }, + "optionalField": { + "description": "This field is not included in required, so is optional", + "type": "number", + "default": 1 + } + }, + "required": ["requiredField"] +} diff --git a/tests/ModuleTemplate.spec.js b/tests/ModuleTemplate.spec.js new file mode 100644 index 0000000..5b05d98 --- /dev/null +++ b/tests/ModuleTemplate.spec.js @@ -0,0 +1,13 @@ +const TemplateModule = require('../lib/TemplateModule'); +const should = require('should'); + +describe('Template module', function() { + before(function(done) { + // do initialisation here + }); + describe('#functionName()', function() { + it('should test for something', function() { + false.should.be(true); + }); + }); +});