adapt-authoring-core 3.0.2 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/conf/config.schema.json +38 -0
- package/docs/writing-a-module.md +30 -1
- package/package.json +1 -1
package/conf/config.schema.json
CHANGED
|
@@ -40,6 +40,44 @@
|
|
|
40
40
|
"description": "The default language used by the server",
|
|
41
41
|
"type": "string",
|
|
42
42
|
"default": "en"
|
|
43
|
+
},
|
|
44
|
+
"appName": {
|
|
45
|
+
"description": "Application name displayed in the UI header and browser tab",
|
|
46
|
+
"type": "string",
|
|
47
|
+
"default": "Adapt",
|
|
48
|
+
"_adapt": { "isPublic": true }
|
|
49
|
+
},
|
|
50
|
+
"primaryColour": {
|
|
51
|
+
"description": "Primary palette colour for the UI theme (hex format)",
|
|
52
|
+
"type": "string",
|
|
53
|
+
"pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
|
|
54
|
+
"default": "#1ec0d9",
|
|
55
|
+
"_adapt": { "isPublic": true }
|
|
56
|
+
},
|
|
57
|
+
"chromeColour": {
|
|
58
|
+
"description": "Chrome colour (navy): icon rail, app bar, headings (hex format)",
|
|
59
|
+
"type": "string",
|
|
60
|
+
"pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
|
|
61
|
+
"default": "#263944",
|
|
62
|
+
"_adapt": { "isPublic": true }
|
|
63
|
+
},
|
|
64
|
+
"commitColour": {
|
|
65
|
+
"description": "Commit colour (mint): the single affirmative action per view, e.g. Save/Create (hex format)",
|
|
66
|
+
"type": "string",
|
|
67
|
+
"pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
|
|
68
|
+
"default": "#00dd95",
|
|
69
|
+
"_adapt": { "isPublic": true }
|
|
70
|
+
},
|
|
71
|
+
"accentColour": {
|
|
72
|
+
"description": "Accent colour (expressive) and the default decorative-icon ink; never a button fill (hex format)",
|
|
73
|
+
"type": "string",
|
|
74
|
+
"pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
|
|
75
|
+
"default": "#ec4899",
|
|
76
|
+
"_adapt": { "isPublic": true }
|
|
77
|
+
},
|
|
78
|
+
"logo": {
|
|
79
|
+
"description": "Absolute path to a custom logo image (PNG recommended — email-safe) to bake into the UI build (overrides the built-in mark) and reuse in branded emails. Leave unset to use the built-in logo.",
|
|
80
|
+
"type": "string"
|
|
43
81
|
}
|
|
44
82
|
}
|
|
45
83
|
}
|
package/docs/writing-a-module.md
CHANGED
|
@@ -122,4 +122,33 @@ If you don't want to publish your module to npm, you can simply provide the URL
|
|
|
122
122
|
"adapt-authoring-mymodule": "https://github.com/MY_GITHUB_ACCOUNT/GITHUB_REPO_NAME.git"
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
```
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Conventions
|
|
128
|
+
|
|
129
|
+
Beyond structure and code, modules follow a few project-wide conventions.
|
|
130
|
+
|
|
131
|
+
### Linting
|
|
132
|
+
|
|
133
|
+
All code must pass [Standard.js](https://standardjs.com/) — no config file is needed. Run `npx standard` in the module root; it must pass before opening a PR.
|
|
134
|
+
|
|
135
|
+
### Testing
|
|
136
|
+
|
|
137
|
+
Write tests with `node:test` and `node:assert/strict` (see [Writing tests](writing-tests)). The project's testable-code conventions:
|
|
138
|
+
|
|
139
|
+
- Extract discrete logic (transformations, mappers, predicates, validators) into one function per file under `lib/utils/<fn>.js`, re-exported via a `lib/utils.js` barrel.
|
|
140
|
+
- Keep logic in the class only when it needs instance state, orchestrates side effects, or is a trivial one-liner delegating to a utility.
|
|
141
|
+
- Each utility gets a matching `tests/utils-<name>.spec.js`, importing the file directly.
|
|
142
|
+
- Use `mock.module()` (before the dynamic `import()`) when the function imports app modules; use table-driven tests for mappers and lookups.
|
|
143
|
+
- Run unit tests with `node --experimental-test-module-mocks --test 'tests/**/*.spec.js'`.
|
|
144
|
+
|
|
145
|
+
### Workflow and releases
|
|
146
|
+
|
|
147
|
+
- Start from a clean `master` (`git checkout master && git pull`), then branch.
|
|
148
|
+
- Commit with `Tag: description (fixes #N)` — the tag determines the release type (see [Contributing code](contributing-code)).
|
|
149
|
+
- Merging to `master` triggers an **immediate** semantic-release publish; there is no staging step between merge and publish (see [Developer workflow](developer-workflow)).
|
|
150
|
+
|
|
151
|
+
### Documentation
|
|
152
|
+
|
|
153
|
+
- Document non-obvious behaviour in `docs/*.md` guides (built into the documentation site), not just inline comments. Cover what the module does, the APIs/seams it exposes, and any gotchas.
|
|
154
|
+
- Keep the guides current: when a change alters documented behaviour, update the relevant `docs/*.md` in the **same PR**. Treat stale docs as a bug.
|