Commit Graph
1 Commits
Author SHA1 Message Date
yetone ceeae93e67 plugin: a plugin added by its path is loaded again when its files change
A plugin added by its path (the user's own folder or file, as its author
has it while writing it) was loaded by the host as it was when the host
started, and an edit reached it only once magpie was quit and opened
again (yansheng1003 on X: "每次改了需要重新magpie"). checkList, which
runs on every call to a plugin, now compares the files of every enabled
path plugin too (names, times, sizes; node_modules and dot folders left
out, 2000 files at most, walked at most once a second), and a change
starts the host again as a plugins.json change already did. The
middleware already reloaded its own files this way.

Run (mote): go test ./internal/plugin -run
'TestPathPluginEdit|TestPathsLookedAt|TestTerminalUpdateRestarts' ok.
Broken by hand: checkList back on listStamp alone, and
TestPathPluginEditRestartsTheHost is red at "the plugin's own code was
edited". The full suite runs with the restart change that follows.
2026-11-18 12:58:37 +08:00