Fix publishing: URL is not a constructor #69

Merged
anas merged 1 commits from fix/url-shadowing into main 2026-10-09 12:59:04 +00:00
Owner

A regression from #68, reported by the owner when publishing حدائقِ بخشش.

Cause: #68 added a constant named URL in moderation.ts. It hid the global URL, which dataDir() uses for the default divan-data folder (new URL("../../../divan-data", import.meta.url)). Every publish without DIVAN_DATA_DIR set failed with "URL is not a constructor".

The tests did not catch it because they always set DIVAN_DATA_DIR, so the default is never evaluated there.

Fix: the constants are renamed TARGET_TITLE and TARGET_URL, with a comment saying why.

Checked: npm test 42 pass; the module loads and the default folder resolves without DIVAN_DATA_DIR. The approved revision 215 is untouched and waiting for the owner to publish it.

🤖 Generated with Claude Code

A regression from #68, reported by the owner when publishing حدائقِ بخشش. **Cause:** #68 added a constant named `URL` in moderation.ts. It hid the global `URL`, which `dataDir()` uses for the default divan-data folder (`new URL("../../../divan-data", import.meta.url)`). Every publish without `DIVAN_DATA_DIR` set failed with "URL is not a constructor". The tests did not catch it because they always set `DIVAN_DATA_DIR`, so the default is never evaluated there. **Fix:** the constants are renamed `TARGET_TITLE` and `TARGET_URL`, with a comment saying why. Checked: `npm test` 42 pass; the module loads and the default folder resolves without `DIVAN_DATA_DIR`. The approved revision 215 is untouched and waiting for the owner to publish it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
anas added 1 commit 2026-10-09 12:58:58 +00:00
anas merged commit cdfa5f9020 into main 2026-10-09 12:59:04 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: anas/divan#69
No description provided.