Skip to content

Fix: schema deregister on delete and migrate from glob to fs.glob#88

Merged
taylortom merged 2 commits into
masterfrom
fix/schema-deregistration-on-delete
Mar 12, 2026
Merged

Fix: schema deregister on delete and migrate from glob to fs.glob#88
taylortom merged 2 commits into
masterfrom
fix/schema-deregistration-on-delete

Conversation

@taylortom

@taylortom taylortom commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #87

Fix

  • Pass schema $anchor names to deregisterSchema() instead of file paths, which never matched
  • Clean up this.pluginSchemas cache when a plugin is deleted
  • Remove unused glob import

Testing

  • Delete a plugin and verify its schemas no longer appear in the schemas list
  • Verify plugin install/update still registers schemas correctly

🔗 Related: cgkineo/adapt-authoring#95

deregisterSchema() expects the schema $anchor name, but was being
passed absolute file paths from glob which never matched.
… tests

- Replace `glob` npm package with `node:fs/promises` glob via a
  `globAbsolute` utility, removing the dependency
- Remove ContentPluginModule.spec.js which tested re-implemented
  copies of source methods rather than real code — these should be
  covered by integration tests
- Add unit tests for the new globAbsolute utility
@taylortom taylortom changed the title Fix: Deregister schemas by name instead of file path Fix: Migrate from glob to fs.glob Mar 12, 2026
@taylortom taylortom changed the title Fix: Migrate from glob to fs.glob Fix: schema deregister on delete and migrate from glob to fs.glob Mar 12, 2026
@taylortom
taylortom merged commit f6491ac into master Mar 12, 2026
2 checks passed
@taylortom
taylortom deleted the fix/schema-deregistration-on-delete branch March 12, 2026 16:24
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.5.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Schemas persist after plugin deletion

1 participant