Fix Windows (WSL) build#58
Open
chrisglein wants to merge 1 commit into
Open
Conversation
- Rewrite songs-to-json (python) as songs-to-json.js (node) to drop the python/shebang dependency - Replace shell 'cp' in build with a cross-platform node fs.cpSync call - Quote nodemon -e pattern with double quotes for cmd/PowerShell - Add patch-package + postinstall and patches/ for pug-pack coffeescript compilation
Draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes made by agents to get local WSL testing and hosting working. Which for me has never worked in this repo ever, as documented in #42, and will enable me to iterate on the site more directly and more confidently.
Changes
Fixes #42
More detailed agent description below. My main 🤨 to the whole thing was it's struggles with Python, which I very much have access to in other environments so I don't know what's up with that. But moving it to JS seems... 🤷♂️ fine. I was just happy to finally be able to host the site.
Fix Windows build
Why
The build didn't run on Windows. Three hard blockers:
./songs-to-jsonis a Python script (#!/usr/bin/env python3) — requires Python and a POSIX shell;cmd/PowerShell can't exec it.cp Songbook.pdf distuses the Unixcp, which doesn't exist on Windows.nodemon -e '*'uses single quotes, which Windowscmdtreats literally (breaks the watch glob).Plus
pug-packfailed to compile the:coffeescriptblocks in index.pug because it relied onpughoistingjstransformer-coffeescriptto the top level, which didn't resolve here.What changed
songs-to-json→ songs-to-json.js: same logic in Node (already a build dependency). Reads UTF-8 with a latin-1 fallback like before, and now normalizes CRLF→LF so output is byte-identical regardless of checkout line endings.buildscript:cpreplaced with a Nodefs.cpSyncone-liner.devscript:-e '*'→-e "*".patch-package+ pug-pack+1.11.0.patch: patches pug-pack to compile:coffeescriptblocks with its bundled compiler instead of depending on module hoisting. Applied automatically via apostinstallhook.Compatibility outside Windows
No regressions on macOS/Linux — every replacement uses cross-platform tooling:
fs.cpSync, the JS script) is already required to build and behaves identically on all platforms.-e "*"is unchanged behavior there.patch-packageis a standard cross-platform npm tool; the patch changes pug-pack's behavior the same way everywhere, making it more robust (no reliance on dependency hoisting), not Windows-specific.Net: unblocks Windows, changes nothing observable for existing Unix users.