Windows support#289
Conversation
- Add isWindows detection - Fix urlToPath to handle Windows drive letters (e.g., C:/) - Fix pathToURL to properly encode Windows paths - Update pcomponents to handle Windows root paths - Add isAbsolutePath helper for cross-platform absolute path detection
- Add isAbsolutePath helper for cross-platform absolute path detection - Support Windows AppData config location - Fix relative path detection for Windows paths
Equivalent functionality to the Unix viv shell script: - Launches vivify-server in background - Monitors for 'STARTUP COMPLETE' signal - Handles errors and provides bug report link - Supports --help and --version flags
Alternative to viv.ps1 for users who prefer batch scripts: - Same functionality as PowerShell version - Works in CMD prompt without PowerShell - Simpler implementation for basic usage
- Add BUILD_DIR_WINDOWS and Windows-specific paths - Add 'windows' target for building on Windows - Copy both viv.ps1 and viv.cmd scripts - Create vivify-server.exe using Node SEA
- Add dev:win and viv:win npm scripts using cross-env - Add cross-env as devDependency for Windows env var support - Create scripts/build-windows.ps1 for easy Windows builds
- Document Windows installation steps - Add Windows build instructions - Document Windows config file locations - Mention Windows support in features list
- Add isWindows detection - Add isAbsolutePath helper for cross-platform support - Update resolveIcon to recognize Windows absolute paths (C:\\, C:\\)
Adds file-based server logging to diagnose client registration: - Logs WebSocket connect/close - Logs PATH registration from browser client - Writes to %TEMP%/vivify-server.log by default (override with VIV_LOG_PATH) Also adds a viv-debug.cmd launcher that runs the Node bundle and enables logs.
Updates viv-debug.cmd to: - Keep server running in background (start /b) - Write startup info to %TEMP%\vivify-server.log - Capture stdout/stderr to %TEMP%\vivify-server.out.log / .err.log - Log if node.exe or bundle.js is missing This prevents the window from closing silently and provides a log to inspect.
viv-debug.cmd now copies bundle.js to bundle.cjs before running node, so Node doesn't treat it as ESM (package.json has type=module). Also keeps startup/error logs in %TEMP% for debugging.
Switch viv-debug.cmd to run src/app.ts via ts-node/esm so that server-side logging is active (it doesn't exist in bundle.js). Captures stdout/stderr to %TEMP% logs and forces VIV_TIMEOUT=0 with NODE_ENV=development.
Fixes ERR_MODULE_NOT_FOUND for ts-node by: - Pointing --loader to node_modules/ts-node/esm.mjs explicitly - Running from repo root (pushd) - Logging a clear error if node_modules is missing Now viv-debug.cmd works without global ts-node.
Uses node_modules/ts-node/dist/bin-esm.js to avoid loader resolution issues. This keeps debug server running from src/app.ts and enables WebSocket path logging in %TEMP%/vivify-server.log.
|
Hi @pidgeon777 Thanks for all your work on this one, sorry it has taken so long to get back to you on this. I had to setup my Windows environment to even test it, then i finished work and had to do it all again at home. So far I got vivify-server.exe to build but then crashes when loading a file or doing a directory listing. This is using your latest commit of 9074ec9 I'm about to head to dinner and will look some more afterwards, what exact version of node are you using?
|
|
Hello @pidgeon777 ! A big thank you also from my side! As I've said in the issue I don't have any windows setup at all so I'll rely on @Tweekism and maybe other people who have commented on the issue to test this. Looking ahead a bit, would you be interested in taking over long-term support/maintenance of Vivify Windows? If so, do you have the messaging app Signal? We have a Vivify contributor group there and would then like to invite you to join so we have an easier means of communication that also doesn't ping people on GitHub. |
|
Hello @Tweekism, I'm still improving the branch. @jannis-baum I would love it, the problem is time. I have one job + running a startup, and time is very limited. Still, I'm working on an updated branch. If there is any issue, I will look at it when possible. |
Yeah we are all a bit like that at the moment. So far this is what I get on my end:-
Error from PowerShell 7.5.4Error from Windows PowerShell 5.1.26100.7462 |
This may be related to how static files are served. The way this works is
If I had to guess where this breaks on Windows I'd say it's here because the paths might not be correct (e.g. classical
TLDR; If the static routing (see above) doesn't work then no websocket connections are established meaning the server doesn't know about its clients meaning it times itself out and terminates. What follows is the long version including how the timeout and the communication between server and client work, this might be relevant once the static routing is fixed. The server will terminate on its own after the timeout when no clients are connected to it. Clients connect to the server via websockets. The timeout kill happens via these functions that are called in To be sure that the websocket clients are active and working there is a ping/pong that happens every second (ping, pong); if the client fails to pong then we consider it disconnected and when there are no more clients (also in the initial state before the first client has connected) the timeout starts. The initial establishing of the connection works as follows and includes communication of which path the client is registered for which is needed for the API, e.g. for the Vim plugin:
|
|
I made many improvements and modifications since my last commit. I have to find some time and check everything before a further push. |

No description provided.