Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-allen-89 authored Nov 1, 2022
0 parents commit ec1717d
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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!
2 changes: 2 additions & 0 deletions adapt-authoring.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
11 changes: 11 additions & 0 deletions conf/config.schema.json
Original file line number Diff line number Diff line change
@@ -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
}
}
}
2 changes: 2 additions & 0 deletions docs/template-doc.md
Original file line number Diff line number Diff line change
@@ -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`.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './lib/TemplateModule.js';
3 changes: 3 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"error.templateerror": "Template error message!"
}
8 changes: 8 additions & 0 deletions lib/TemplateModule.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { AbstractModule } from 'adapt-authoring-core';

export default class TemplateModule extends AbstractModule {
/** @override */
async init() {
// do custom initialisation here
}
}
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
18 changes: 18 additions & 0 deletions schema/template.schema.json
Original file line number Diff line number Diff line change
@@ -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"]
}
13 changes: 13 additions & 0 deletions tests/ModuleTemplate.spec.js
Original file line number Diff line number Diff line change
@@ -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);
});
});
});

0 comments on commit ec1717d

Please sign in to comment.