pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/www/py-zensical
Module Name: pkgsrc
Committed By: wiz
Date: Wed Oct 14 20:14:25 UTC 2026
Modified Files:
pkgsrc/www/py-zensical: Makefile PLIST distinfo
Added Files:
pkgsrc/www/py-zensical/patches:
patch-crates_zensical-watch_src_agent_monitor.rs
patch-crates_zensical_src_watcher.rs
Log Message:
py-zensical: update to 0.0.70nb1.
In addition to the changes from below, this includes a post-release
bugfix, which is why it jumps to nb1 immediately.
0.0.70:
Zensical now supports the exclude_docs, draft_docs, and not_in_nav
settings from mkdocs.yml for excluding files, previewing drafts,
and keeping pages out of automatic navigation.
Additionally, the user interface is updated to v0.0.37, improving
search accessibility and reliability, adding draft markers and
discovery links for llms.txt and Markdown, and introducing 17 new
icons, including :simple-zensical:.
To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 pkgsrc/www/py-zensical/Makefile
cvs rdiff -u -r1.12 -r1.13 pkgsrc/www/py-zensical/PLIST
cvs rdiff -u -r1.15 -r1.16 pkgsrc/www/py-zensical/distinfo
cvs rdiff -u -r0 -r1.1 \
pkgsrc/www/py-zensical/patches/patch-crates_zensical-watch_src_agent_monitor.rs \
pkgsrc/www/py-zensical/patches/patch-crates_zensical_src_watcher.rs
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/www/py-zensical/Makefile
diff -u pkgsrc/www/py-zensical/Makefile:1.16 pkgsrc/www/py-zensical/Makefile:1.17
--- pkgsrc/www/py-zensical/Makefile:1.16 Mon Oct 12 14:05:47 2026
+++ pkgsrc/www/py-zensical/Makefile Wed Oct 14 20:14:24 2026
@@ -1,10 +1,11 @@
-# $NetBSD: Makefile,v 1.16 2026/10/12 14:05:47 wiz Exp $
+# $NetBSD: Makefile,v 1.17 2026/10/14 20:14:24 wiz Exp $
#
# Changelog:
# https://github.com/zensical/zensical/releases
-DISTNAME= zensical-0.0.69
+DISTNAME= zensical-0.0.70
PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
+PKGREVISION= 1
CATEGORIES= www textproc python
MASTER_SITES= ${MASTER_SITE_PYPI:=z/zensical/}
Index: pkgsrc/www/py-zensical/PLIST
diff -u pkgsrc/www/py-zensical/PLIST:1.12 pkgsrc/www/py-zensical/PLIST:1.13
--- pkgsrc/www/py-zensical/PLIST:1.12 Mon Oct 12 14:05:47 2026
+++ pkgsrc/www/py-zensical/PLIST Wed Oct 14 20:14:24 2026
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.12 2026/10/12 14:05:47 wiz Exp $
+@comment $NetBSD: PLIST,v 1.13 2026/10/14 20:14:24 wiz Exp $
bin/zensical-${PYVERSSUFFIX}
${PYSITELIB}/${WHEEL_INFODIR}/METADATA
${PYSITELIB}/${WHEEL_INFODIR}/RECORD
@@ -3941,6 +3941,7 @@ ${PYSITELIB}/zensical/templates/.icons/l
${PYSITELIB}/zensical/templates/.icons/lucide/grip-horizontal.svg
${PYSITELIB}/zensical/templates/.icons/lucide/grip-vertical.svg
${PYSITELIB}/zensical/templates/.icons/lucide/grip.svg
+${PYSITELIB}/zensical/templates/.icons/lucide/groceries.svg
${PYSITELIB}/zensical/templates/.icons/lucide/group.svg
${PYSITELIB}/zensical/templates/.icons/lucide/guitar.svg
${PYSITELIB}/zensical/templates/.icons/lucide/ham.svg
@@ -3955,6 +3956,7 @@ ${PYSITELIB}/zensical/templates/.icons/l
${PYSITELIB}/zensical/templates/.icons/lucide/hand-platter.svg
${PYSITELIB}/zensical/templates/.icons/lucide/hand.svg
${PYSITELIB}/zensical/templates/.icons/lucide/handbag.svg
+${PYSITELIB}/zensical/templates/.icons/lucide/handle-bottom-right.svg
${PYSITELIB}/zensical/templates/.icons/lucide/handshake.svg
${PYSITELIB}/zensical/templates/.icons/lucide/hard-drive-download.svg
${PYSITELIB}/zensical/templates/.icons/lucide/hard-drive-upload.svg
@@ -3989,6 +3991,7 @@ ${PYSITELIB}/zensical/templates/.icons/l
${PYSITELIB}/zensical/templates/.icons/lucide/helping-hand.svg
${PYSITELIB}/zensical/templates/.icons/lucide/hexagon.svg
${PYSITELIB}/zensical/templates/.icons/lucide/highlighter.svg
+${PYSITELIB}/zensical/templates/.icons/lucide/hiking-stick.svg
${PYSITELIB}/zensical/templates/.icons/lucide/history.svg
${PYSITELIB}/zensical/templates/.icons/lucide/home.svg
${PYSITELIB}/zensical/templates/.icons/lucide/hop-off.svg
@@ -4088,6 +4091,7 @@ ${PYSITELIB}/zensical/templates/.icons/l
${PYSITELIB}/zensical/templates/.icons/lucide/lectern.svg
${PYSITELIB}/zensical/templates/.icons/lucide/lens-concave.svg
${PYSITELIB}/zensical/templates/.icons/lucide/lens-convex.svg
+${PYSITELIB}/zensical/templates/.icons/lucide/lens.svg
${PYSITELIB}/zensical/templates/.icons/lucide/letter-text.svg
${PYSITELIB}/zensical/templates/.icons/lucide/letters.svg
${PYSITELIB}/zensical/templates/.icons/lucide/library-big.svg
@@ -4154,6 +4158,7 @@ ${PYSITELIB}/zensical/templates/.icons/l
${PYSITELIB}/zensical/templates/.icons/lucide/mail-badge.svg
${PYSITELIB}/zensical/templates/.icons/lucide/mail-check.svg
${PYSITELIB}/zensical/templates/.icons/lucide/mail-clock.svg
+${PYSITELIB}/zensical/templates/.icons/lucide/mail-dot.svg
${PYSITELIB}/zensical/templates/.icons/lucide/mail-minus.svg
${PYSITELIB}/zensical/templates/.icons/lucide/mail-open.svg
${PYSITELIB}/zensical/templates/.icons/lucide/mail-pen.svg
@@ -4415,6 +4420,7 @@ ${PYSITELIB}/zensical/templates/.icons/l
${PYSITELIB}/zensical/templates/.icons/lucide/phone-call.svg
${PYSITELIB}/zensical/templates/.icons/lucide/phone-forwarded.svg
${PYSITELIB}/zensical/templates/.icons/lucide/phone-incoming.svg
+${PYSITELIB}/zensical/templates/.icons/lucide/phone-log.svg
${PYSITELIB}/zensical/templates/.icons/lucide/phone-missed.svg
${PYSITELIB}/zensical/templates/.icons/lucide/phone-off.svg
${PYSITELIB}/zensical/templates/.icons/lucide/phone-outgoing.svg
@@ -4590,8 +4596,10 @@ ${PYSITELIB}/zensical/templates/.icons/l
${PYSITELIB}/zensical/templates/.icons/lucide/scissors-square.svg
${PYSITELIB}/zensical/templates/.icons/lucide/scissors.svg
${PYSITELIB}/zensical/templates/.icons/lucide/scooter.svg
+${PYSITELIB}/zensical/templates/.icons/lucide/scratch-blocks.svg
${PYSITELIB}/zensical/templates/.icons/lucide/screen-share-off.svg
${PYSITELIB}/zensical/templates/.icons/lucide/screen-share.svg
+${PYSITELIB}/zensical/templates/.icons/lucide/screw.svg
${PYSITELIB}/zensical/templates/.icons/lucide/scroll-text.svg
${PYSITELIB}/zensical/templates/.icons/lucide/scroll.svg
${PYSITELIB}/zensical/templates/.icons/lucide/search-alert.svg
@@ -4628,6 +4636,7 @@ ${PYSITELIB}/zensical/templates/.icons/l
${PYSITELIB}/zensical/templates/.icons/lucide/shield-cog.svg
${PYSITELIB}/zensical/templates/.icons/lucide/shield-ellipsis.svg
${PYSITELIB}/zensical/templates/.icons/lucide/shield-half.svg
+${PYSITELIB}/zensical/templates/.icons/lucide/shield-house.svg
${PYSITELIB}/zensical/templates/.icons/lucide/shield-keyhole.svg
${PYSITELIB}/zensical/templates/.icons/lucide/shield-lock.svg
${PYSITELIB}/zensical/templates/.icons/lucide/shield-minus.svg
@@ -5002,6 +5011,7 @@ ${PYSITELIB}/zensical/templates/.icons/l
${PYSITELIB}/zensical/templates/.icons/lucide/user-round-pen.svg
${PYSITELIB}/zensical/templates/.icons/lucide/user-round-plus.svg
${PYSITELIB}/zensical/templates/.icons/lucide/user-round-search.svg
+${PYSITELIB}/zensical/templates/.icons/lucide/user-round-star.svg
${PYSITELIB}/zensical/templates/.icons/lucide/user-round-x.svg
${PYSITELIB}/zensical/templates/.icons/lucide/user-round.svg
${PYSITELIB}/zensical/templates/.icons/lucide/user-search.svg
@@ -5074,6 +5084,7 @@ ${PYSITELIB}/zensical/templates/.icons/l
${PYSITELIB}/zensical/templates/.icons/lucide/whole-word.svg
${PYSITELIB}/zensical/templates/.icons/lucide/wifi-cog.svg
${PYSITELIB}/zensical/templates/.icons/lucide/wifi-high.svg
+${PYSITELIB}/zensical/templates/.icons/lucide/wifi-lock.svg
${PYSITELIB}/zensical/templates/.icons/lucide/wifi-low.svg
${PYSITELIB}/zensical/templates/.icons/lucide/wifi-off.svg
${PYSITELIB}/zensical/templates/.icons/lucide/wifi-pen.svg
@@ -13104,6 +13115,8 @@ ${PYSITELIB}/zensical/templates/.icons/o
${PYSITELIB}/zensical/templates/.icons/octicons/redo-24.svg
${PYSITELIB}/zensical/templates/.icons/octicons/rel-file-path-16.svg
${PYSITELIB}/zensical/templates/.icons/octicons/rel-file-path-24.svg
+${PYSITELIB}/zensical/templates/.icons/octicons/release-16.svg
+${PYSITELIB}/zensical/templates/.icons/octicons/release-24.svg
${PYSITELIB}/zensical/templates/.icons/octicons/reply-16.svg
${PYSITELIB}/zensical/templates/.icons/octicons/reply-24.svg
${PYSITELIB}/zensical/templates/.icons/octicons/repo-16.svg
@@ -13311,6 +13324,8 @@ ${PYSITELIB}/zensical/templates/.icons/o
${PYSITELIB}/zensical/templates/.icons/octicons/view-files-24.svg
${PYSITELIB}/zensical/templates/.icons/octicons/vscode-16.svg
${PYSITELIB}/zensical/templates/.icons/octicons/vscode-24.svg
+${PYSITELIB}/zensical/templates/.icons/octicons/wall-16.svg
+${PYSITELIB}/zensical/templates/.icons/octicons/wall-24.svg
${PYSITELIB}/zensical/templates/.icons/octicons/webhook-16.svg
${PYSITELIB}/zensical/templates/.icons/octicons/workflow-16.svg
${PYSITELIB}/zensical/templates/.icons/octicons/workflow-24.svg
@@ -13564,6 +13579,7 @@ ${PYSITELIB}/zensical/templates/.icons/s
${PYSITELIB}/zensical/templates/.icons/simple/asciinema.svg
${PYSITELIB}/zensical/templates/.icons/simple/asda.svg
${PYSITELIB}/zensical/templates/.icons/simple/aseprite.svg
+${PYSITELIB}/zensical/templates/.icons/simple/aspire.svg
${PYSITELIB}/zensical/templates/.icons/simple/assemblyscript.svg
${PYSITELIB}/zensical/templates/.icons/simple/asterisk.svg
${PYSITELIB}/zensical/templates/.icons/simple/astonmartin.svg
@@ -16771,6 +16787,7 @@ ${PYSITELIB}/zensical/templates/.icons/s
${PYSITELIB}/zensical/templates/.icons/simple/zenn.svg
${PYSITELIB}/zensical/templates/.icons/simple/zenodo.svg
${PYSITELIB}/zensical/templates/.icons/simple/zensar.svg
+${PYSITELIB}/zensical/templates/.icons/simple/zensical.svg
${PYSITELIB}/zensical/templates/.icons/simple/zerodha.svg
${PYSITELIB}/zensical/templates/.icons/simple/zerotier.svg
${PYSITELIB}/zensical/templates/.icons/simple/zettlr.svg
@@ -16798,12 +16815,12 @@ ${PYSITELIB}/zensical/templates/.icons/s
${PYSITELIB}/zensical/templates/404.html
${PYSITELIB}/zensical/templates/assets/images/favicon.png
${PYSITELIB}/zensical/templates/assets/javascripts/LICENSE
-${PYSITELIB}/zensical/templates/assets/javascripts/bundle.8b1c90bd.min.js
-${PYSITELIB}/zensical/templates/assets/javascripts/workers/search.7d14d953.min.js
-${PYSITELIB}/zensical/templates/assets/stylesheets/classic/main.3d7537f3.min.css
-${PYSITELIB}/zensical/templates/assets/stylesheets/classic/palette.031959be.min.css
-${PYSITELIB}/zensical/templates/assets/stylesheets/modern/main.e15858d4.min.css
-${PYSITELIB}/zensical/templates/assets/stylesheets/modern/palette.b27955a4.min.css
+${PYSITELIB}/zensical/templates/assets/javascripts/bundle.a2388154.min.js
+${PYSITELIB}/zensical/templates/assets/javascripts/workers/search.c47bb847.min.js
+${PYSITELIB}/zensical/templates/assets/stylesheets/classic/main.68ef4dbf.min.css
+${PYSITELIB}/zensical/templates/assets/stylesheets/classic/palette.813d4b3f.min.css
+${PYSITELIB}/zensical/templates/assets/stylesheets/modern/main.e442bf79.min.css
+${PYSITELIB}/zensical/templates/assets/stylesheets/modern/palette.b60ce83d.min.css
${PYSITELIB}/zensical/templates/base.html
${PYSITELIB}/zensical/templates/blog-post.html
${PYSITELIB}/zensical/templates/blog.html
Index: pkgsrc/www/py-zensical/distinfo
diff -u pkgsrc/www/py-zensical/distinfo:1.15 pkgsrc/www/py-zensical/distinfo:1.16
--- pkgsrc/www/py-zensical/distinfo:1.15 Mon Oct 12 14:05:48 2026
+++ pkgsrc/www/py-zensical/distinfo Wed Oct 14 20:14:24 2026
@@ -1,5 +1,8 @@
-$NetBSD: distinfo,v 1.15 2026/10/12 14:05:48 wiz Exp $
+$NetBSD: distinfo,v 1.16 2026/10/14 20:14:24 wiz Exp $
+BLAKE2s (812f06be8b308f5dffcc2796bffb4c4931b9bf6d.diff) = bafc6f7c4017824c225a9bf97c7efdd965e802f836ec6d022d4d02f7bbae9282
+SHA512 (812f06be8b308f5dffcc2796bffb4c4931b9bf6d.diff) = 9e69ba520f9b071e22fcc32820278e5d53ee899b54261d5b4c3256c78e631a3cb1387fa8d8430f09d13c4c21c0d424713287d0877e878a42233ea847b581086c
+Size (812f06be8b308f5dffcc2796bffb4c4931b9bf6d.diff) = 25031 bytes
BLAKE2s (adler2-2.0.1.crate) = 4d391e0fcde91c7435ee9a5503fee4a5346f549f1b45e482ce3e1e151d90f8f5
SHA512 (adler2-2.0.1.crate) = 555b2b7ba6f8116acccd0bcd16ed34cc78162c81023cff31a8566ffcd456c03832089fca2d5b668ceaac4fe8f922d31aa9c487f226a36cace294ff4a219bd91d
Size (adler2-2.0.1.crate) = 13366 bytes
@@ -1059,9 +1062,9 @@ Size (yoke-0.8.3.crate) = 33132 bytes
BLAKE2s (yoke-derive-0.8.2.crate) = 5552ca3b0c844667a0532da6e6a4bbfc41777d56d6615f80ca4c90020a50dedf
SHA512 (yoke-derive-0.8.2.crate) = ed37289fe2dfcafda13be24b3e4aae1fbbdd6f52c42a1f2d770771f458af0d17b4cbe487941381b4bd692388e9818b45c686bdcd6229918e0f5b6fced1068ca3
Size (yoke-derive-0.8.2.crate) = 15077 bytes
-BLAKE2s (zensical-0.0.69.tar.gz) = b7109bed1520503b6dd6a73d23e19f3bfb95807351e022f92fe636882186ca7e
-SHA512 (zensical-0.0.69.tar.gz) = f47140dd6c53dc514272ccaf243b97ea8bd4fe5447675f856c9583bccb144820c5e8be489fe50f967f96098e5994b9c1331daec917d1fa322864a437d28950b3
-Size (zensical-0.0.69.tar.gz) = 4312939 bytes
+BLAKE2s (zensical-0.0.70.tar.gz) = 2eb4825564ca09be18fabeed5288856f15c08feb5abee244a8610e3239644ce0
+SHA512 (zensical-0.0.70.tar.gz) = 591dc55d358a1f6f4c02d828da68b007334190d65d2ece8a86c5aa101d5608f03ec88a37cad8a241d6e12fba91ad632c793dfc450d99000dd7f7be6d5b9fc809
+Size (zensical-0.0.70.tar.gz) = 4319716 bytes
BLAKE2s (zerocopy-0.8.53.crate) = e54df3825c175c34ea7e8018039c860ce591756435ed3afa8735ddfefd16917c
SHA512 (zerocopy-0.8.53.crate) = c2f1fabfcc5ce8badb1b69b395ef1394bc4cc88b795e095b22347fd4cefc5c195a4013e8a05a2327ef1e45aad65f6e562a08c7c03a62d3aec149701cb6da0be8
Size (zerocopy-0.8.53.crate) = 284705 bytes
@@ -1132,3 +1135,5 @@ BLAKE2s (zune-jpeg-0.5.15.crate) = a84f7
SHA512 (zune-jpeg-0.5.15.crate) = 99f072129bc11873b25886d73392012a08636575c85ed9237fb8ad247a66ff188b2bd67aa303931f94501735c24ceac24d414186e7ef5010a639f08fbdc855af
Size (zune-jpeg-0.5.15.crate) = 88879 bytes
SHA1 (patch-Cargo.toml) = fa617f0df3197148e23a56a7ecd50fcc75107dec
+SHA1 (patch-crates_zensical-watch_src_agent_monitor.rs) = 28d66a2b37f6c89084d378c1a6ac843dce94ed4a
+SHA1 (patch-crates_zensical_src_watcher.rs) = 0e4470b3e74967cf0ce803fcf1bcce4717cf5972
Added files:
Index: pkgsrc/www/py-zensical/patches/patch-crates_zensical-watch_src_agent_monitor.rs
diff -u /dev/null pkgsrc/www/py-zensical/patches/patch-crates_zensical-watch_src_agent_monitor.rs:1.1
--- /dev/null Wed Oct 14 20:14:25 2026
+++ pkgsrc/www/py-zensical/patches/patch-crates_zensical-watch_src_agent_monitor.rs Wed Oct 14 20:14:25 2026
@@ -0,0 +1,104 @@
+$NetBSD: patch-crates_zensical-watch_src_agent_monitor.rs,v 1.1 2026/10/14 20:14:25 wiz Exp $
+
+https://github.com/zensical/zensical/issues/1035
+
+--- crates/zensical-watch/src/agent/monitor.rs.orig 2006-07-24 01:21:28.000000000 +0000
++++ crates/zensical-watch/src/agent/monitor.rs
+@@ -26,9 +26,10 @@ use crossbeam::channel::{unbounded, Receiver, TryIter}
+ //! File monitor.
+
+ use crossbeam::channel::{unbounded, Receiver, TryIter};
++use notify::event::ModifyKind;
+ use notify::{
+- Config, Event, PollWatcher, RecommendedWatcher, RecursiveMode, Result,
+- Watcher, WatcherKind,
++ Config, Event, EventKind, PollWatcher, RecommendedWatcher, RecursiveMode,
++ Result, Watcher, WatcherKind,
+ };
+ use std::collections::btree_map::Entry;
+ use std::collections::BTreeMap;
+@@ -573,6 +574,15 @@ where
+ where
+ W: 'static + Watcher,
+ {
++ // IN_ATTRIB is emitted for metadata changes, including hardlink counts
++ // changed by package installations. These events, including timestamp-only
++ // changes, are ignored; content writes and renames are reported separately.
++ if W::kind() == Kind::Inotify
++ && matches!(event.kind, EventKind::Modify(ModifyKind::Metadata(_)))
++ {
++ return None;
++ }
++
+ // Unfortunately, the `kqueue` file watcher backend spuriously emits paths
+ // that were not actually touched if changes are detected inside symbolic
+ // links, which is why we must check for them and ignore them. Only perform
+@@ -595,4 +605,68 @@ where
+ true
+ }
+ .then_some(event)
++}
++
++// ----------------------------------------------------------------------------
++// Tests
++// ----------------------------------------------------------------------------
++
++#[cfg(test)]
++mod tests {
++ use notify::event::MetadataKind;
++
++ use super::{filter, Event, EventKind, ModifyKind, PollWatcher};
++
++ #[cfg(target_os = "linux")]
++ #[test]
++ fn inotify_metadata_events_are_ignored() {
++ use notify::INotifyWatcher;
++
++ // Link counts and timestamps are included in inotify's metadata events.
++ for metadata in [
++ MetadataKind::Any,
++ MetadataKind::AccessTime,
++ MetadataKind::WriteTime,
++ MetadataKind::Permissions,
++ MetadataKind::Ownership,
++ MetadataKind::Extended,
++ MetadataKind::Other,
++ ] {
++ let event =
++ Event::new(EventKind::Modify(ModifyKind::Metadata(metadata)))
++ .add_path("template.html".into());
++
++ assert!(filter::<INotifyWatcher>(event).is_none());
++ }
++ }
++
++ #[cfg(target_os = "linux")]
++ #[test]
++ fn inotify_content_and_path_changes_are_preserved() {
++ use notify::event::{CreateKind, DataChange, RemoveKind, RenameMode};
++ use notify::INotifyWatcher;
++
++ // Content writes and path changes must still reach the file manager.
++ for kind in [
++ EventKind::Create(CreateKind::File),
++ EventKind::Modify(ModifyKind::Data(DataChange::Content)),
++ EventKind::Modify(ModifyKind::Name(RenameMode::Both)),
++ EventKind::Remove(RemoveKind::File),
++ ] {
++ let event = Event::new(kind).add_path("template.html".into());
++
++ assert_eq!(filter::<INotifyWatcher>(event.clone()), Some(event));
++ }
++ }
++
++ #[test]
++ fn polling_metadata_events_are_preserved() {
++ // Metadata events from other backends are passed through unchanged.
++ let event = Event::new(EventKind::Modify(ModifyKind::Metadata(
++ MetadataKind::WriteTime,
++ )))
++ .add_path("template.html".into());
++
++ assert_eq!(filter::<PollWatcher>(event.clone()), Some(event));
++ }
+ }
Index: pkgsrc/www/py-zensical/patches/patch-crates_zensical_src_watcher.rs
diff -u /dev/null pkgsrc/www/py-zensical/patches/patch-crates_zensical_src_watcher.rs:1.1
--- /dev/null Wed Oct 14 20:14:25 2026
+++ pkgsrc/www/py-zensical/patches/patch-crates_zensical_src_watcher.rs Wed Oct 14 20:14:25 2026
@@ -0,0 +1,208 @@
+$NetBSD: patch-crates_zensical_src_watcher.rs,v 1.1 2026/10/14 20:14:25 wiz Exp $
+
+https://github.com/zensical/zensical/issues/1035
+
+--- crates/zensical/src/watcher.rs.orig 2006-07-24 01:21:28.000000000 +0000
++++ crates/zensical/src/watcher.rs
+@@ -237,30 +237,17 @@ impl Watcher {
+ {
+ continue;
+ }
+- // Check if the config file reloaded, and terminate agent,
+- // as we need to kick off the entire pipeline again
+- if event_path == config_path && !seen.insert(event.path()) {
++ if should_restart(
++ &event,
++ &event_path,
++ &config_path,
++ &theme_dirs,
++ &watched_files,
++ &mut seen,
++ ) {
+ return Err(Error::Disconnected);
+ }
+
+- // Check if the event is in any of the theme directories
+- // and restart the build if we've already seen the file
+- for dir in &theme_dirs {
+- if event_path.starts_with(dir)
+- && !seen.insert(event.path())
+- {
+- return Err(Error::Disconnected);
+- }
+- }
+-
+- // Check if one of the source files managed by mkdocstrings
+- // changed, and restart the build
+- if watched_files.contains(&event_path)
+- && !seen.insert(event.path())
+- {
+- return Err(Error::Disconnected);
+- }
+-
+ // Ignore events in the site directory, since they are files
+ // that were generated and should not trigger a rebuild. We
+ // forward them to the reload channel in the server instead,
+@@ -475,16 +462,161 @@ fn canonical_or_clone(path: &Path) -> PathBuf {
+ fs::canonicalize(path).unwrap_or_else(|_| path.to_path_buf())
+ }
+
++/// A restart is requested when a previously discovered input is seen again.
++fn should_restart(
++ event: &Event, event_path: &Path, config_path: &Path,
++ theme_dirs: &[PathBuf], watched_files: &BTreeSet<PathBuf>,
++ seen: &mut BTreeSet<Arc<PathBuf>>,
++) -> bool {
++ // Discovery is recorded once per event because restart categories can overlap.
++ let watched = event_path == config_path
++ || theme_dirs.iter().any(|dir| event_path.starts_with(dir))
++ || watched_files.contains(event_path);
++ watched && !seen.insert(event.path())
++}
++
+ // ----------------------------------------------------------------------------
+ // Tests
+ // ----------------------------------------------------------------------------
+
+ #[cfg(test)]
+ mod tests {
++ use std::collections::BTreeSet;
++ use std::path::PathBuf;
++ use std::sync::Arc;
+ use std::{fs, io};
+ use tempfile::tempdir;
+
+- use super::{to_id, Manager, SourceMount};
++ use super::{should_restart, to_id, Event, Kind, Manager, SourceMount};
++
++ #[test]
++ fn restart_inputs_are_discovered_once_and_restarted_after_edits() {
++ let config = PathBuf::from("project/zensical.toml");
++ let theme = PathBuf::from("project/docs/.overrides");
++ let icon = theme.join(".icons/custom.svg");
++ let template = theme.join("main.html");
++ let include = PathBuf::from("project/docs/fragment.j2");
++
++ // Inputs are covered by individual and overlapping restart categories.
++ let cases = [
++ (config.clone(), vec![], BTreeSet::new()),
++ (template, vec![theme.clone()], BTreeSet::new()),
++ (include.clone(), vec![], BTreeSet::from([include])),
++ (config.clone(), vec![], BTreeSet::from([config.clone()])),
++ (
++ icon.clone(),
++ vec![theme.clone()],
++ BTreeSet::from([icon.clone()]),
++ ),
++ (
++ icon.clone(),
++ vec![theme.clone(), theme.join(".icons")],
++ BTreeSet::new(),
++ ),
++ ];
++
++ for (path, theme_dirs, watched_files) in cases {
++ let mut seen = BTreeSet::new();
++ let discovery = Event::Create {
++ kind: Kind::File,
++ path: Arc::new(path.clone()),
++ };
++
++ // Initial discovery must be admitted even if categories overlap.
++ assert!(
++ !should_restart(
++ &discovery,
++ &path,
++ &config,
++ &theme_dirs,
++ &watched_files,
++ &mut seen,
++ ),
++ "initial discovery of {path:?}"
++ );
++
++ let edit = Event::Modify {
++ kind: Kind::File,
++ path: Arc::new(path.clone()),
++ };
++
++ // A restart must still be requested by a subsequent edit.
++ assert!(
++ should_restart(
++ &edit,
++ &path,
++ &config,
++ &theme_dirs,
++ &watched_files,
++ &mut seen,
++ ),
++ "edit to {path:?}"
++ );
++ }
++ }
++
++ #[test]
++ fn ordinary_document_edits_do_not_restart_the_build() {
++ let path = PathBuf::from("project/docs/index.md");
++ let event = Event::Modify {
++ kind: Kind::File,
++ path: Arc::new(path.clone()),
++ };
++ let config = PathBuf::from("project/zensical.toml");
++ let mut seen = BTreeSet::new();
++
++ // Ordinary document events are admitted to the existing workflow.
++ for _ in 0..2 {
++ assert!(!should_restart(
++ &event,
++ &path,
++ &config,
++ &[],
++ &BTreeSet::new(),
++ &mut seen,
++ ));
++ }
++ }
++
++ #[test]
++ fn watched_symlink_aliases_are_discovered_independently() {
++ let config = PathBuf::from("project/zensical.toml");
++ let target = PathBuf::from("project/fragment.j2");
++ let watched_files = BTreeSet::from([target.clone()]);
++ let mut seen = BTreeSet::new();
++
++ // Aliases are resolved to the same watched target during discovery.
++ for path in ["project/docs/first.j2", "project/docs/second.j2"] {
++ let discovery = Event::Create {
++ kind: Kind::Link,
++ path: Arc::new(PathBuf::from(path)),
++ };
++
++ assert!(!should_restart(
++ &discovery,
++ &target,
++ &config,
++ &[],
++ &watched_files,
++ &mut seen,
++ ));
++ }
++
++ let edit = Event::Modify {
++ kind: Kind::Link,
++ path: Arc::new(PathBuf::from("project/docs/first.j2")),
++ };
++
++ // A restart must be requested when an existing alias is seen again.
++ assert!(should_restart(
++ &edit,
++ &target,
++ &config,
++ &[],
++ &watched_files,
++ &mut seen,
++ ));
++ }
+
+ #[test]
+ fn hidden_directory_discovery_is_limited_to_documentation() {
Home |
Main Index |
Thread Index |
Old Index