@rpgm-tools/neo-angband-mod-sdk 0.12.0 → 0.13.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.
|
@@ -310,8 +310,15 @@ if (failed) process.exitCode = 1;
|
|
|
310
310
|
*
|
|
311
311
|
* The same rules as the host's validateModPlugin, restated here rather than imported
|
|
312
312
|
* because that module lives in the web front end and this is a plain script the SDK
|
|
313
|
-
* ships.
|
|
314
|
-
*
|
|
313
|
+
* ships. Importing a compiled copy would tie the build step to whether the front end
|
|
314
|
+
* happens to have been built.
|
|
315
|
+
*
|
|
316
|
+
* A HAND-WRITTEN MIRROR DRIFTS, and this one did. When ModPlugin grew `controller`,
|
|
317
|
+
* the host learned about it and this did not - so the Borg, whose only member is a
|
|
318
|
+
* controller, built fine in the host's eyes and was refused here as "would do
|
|
319
|
+
* nothing". The two lists are now cross-checked against each other by
|
|
320
|
+
* plugin-abi-agreement.test.ts, which reads both files: the duplication is allowed
|
|
321
|
+
* to exist, but not to disagree.
|
|
315
322
|
*/
|
|
316
323
|
function pluginProblem(plugin) {
|
|
317
324
|
if (plugin === null || plugin === undefined) return "plugin.js has no default export";
|
|
@@ -319,10 +326,14 @@ function pluginProblem(plugin) {
|
|
|
319
326
|
return `plugin.js default-exports a ${typeof plugin}, not a plugin object`;
|
|
320
327
|
}
|
|
321
328
|
if (!Number.isInteger(plugin.api)) return 'plugin.js declares no integer "api" version';
|
|
322
|
-
if (
|
|
323
|
-
|
|
329
|
+
if (
|
|
330
|
+
plugin.hooks === undefined &&
|
|
331
|
+
plugin.register === undefined &&
|
|
332
|
+
plugin.controller === undefined
|
|
333
|
+
) {
|
|
334
|
+
return "plugin.js declares no hooks, register or controller, so it would do nothing";
|
|
324
335
|
}
|
|
325
|
-
for (const name of ["hooks", "register", "uninstall"]) {
|
|
336
|
+
for (const name of ["hooks", "register", "controller", "uninstall"]) {
|
|
326
337
|
if (plugin[name] !== undefined && typeof plugin[name] !== "function") {
|
|
327
338
|
return `plugin.js: ${name} is not a function`;
|
|
328
339
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpgm-tools/neo-angband-mod-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Pack schemas, validation, and tooling for Neo Angband mods (content packs, tile packs, scripted plugins)",
|
|
5
5
|
"license": "GPL-2.0-only",
|
|
6
6
|
"author": "neostryder (RPGM Tools)",
|