ci: add Windows job to verify .cmd and HOME fallback fixes#17
Merged
Conversation
Matrix-ize lint/build across ubuntu+windows, add a unit job that runs the bun:test suite on both OSes (previously not in CI at all), and add a focused windows-qmd-smoke job that: - demonstrates Node's stock execFile cannot launch qmd.cmd on Windows (continue-on-error, informational only) - asserts setupQmdCollection() succeeds through the wrapped execFile - asserts resolveMemoryDir() falls back to USERPROFILE when HOME is unset, with no literal '~' subdirectory in the resolved path Gives us a runnable signal for PR #11 before merging it. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Jay Zeng <jayzeng@users.noreply.github.com>
actions/checkout on windows-latest converts LF to CRLF, which trips biome's formatter check on every TS file. Pin all text files to LF so the lint job behaves identically across OSes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Jay Zeng <jayzeng@users.noreply.github.com>
Signed-off-by: Jay Zeng <jayzeng@users.noreply.github.com>
Signed-off-by: Jay Zeng <jayzeng@users.noreply.github.com>
npm install -g @tobilu/qmd on modern npm + Node 22 produces only qmd.ps1 (no qmd.cmd), and cmd.exe's default PATHEXT does not include .PS1. The previous wrapper used `shell: true`, which spawns cmd.exe and therefore could not resolve the .ps1 shim. Replace the options wrapper with buildQmdSpawn, which on Windows transforms qmd calls into `powershell.exe -NoProfile -NoLogo -Command "& qmd '<arg>' ...; exit $LASTEXITCODE"`. PS resolves qmd against .cmd/.exe/.ps1, and single- quoted PS literals neutralize $/backticks so paths with spaces or $ pass through unchanged. PI_QMD_POWERSHELL env var allows forcing pwsh. Also dump npm prefix shims + Get-Command -All in the windows-qmd-smoke job for diagnostics, and verify qmd via the same path the wrapper uses. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Jay Zeng <jayzeng@users.noreply.github.com>
CI diagnostic revealed that npm install -g @tobilu/qmd produces all three shims (qmd, qmd.cmd, qmd.ps1) but cmd-shim writes the literal `/bin/sh` from the package's shebang into both qmd.cmd and qmd.ps1, so both shims fail: cmd.exe with "system cannot find the path specified" and PowerShell with "'/bin/sh.exe' is not recognized". This means PowerShell wrapping (the previous fix) can't help — the .ps1 shim itself is broken outside cygwin/git-bash trees. Replace the PS wrapper with direct node invocation: on Windows, walk PATH for a sibling node_modules/@tobilu/qmd/dist/cli/qmd.js (where both npm and pnpm install) and spawn `node <qmd.js> <args>`. This mirrors what bin/qmd itself does (`exec node "$JS" "$@"`) for npm-installed packages, skipping the broken shims entirely. The resolution is cached for the session; resetQmdJsResolution is exposed for tests. Add resolveQmdJsPath tests against a real temp tree, and update the windows-qmd-smoke job to verify the direct-node path the wrapper now uses (and keep the diagnostic dump of npm prefix + Get-Command -All). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Jay Zeng <jayzeng@users.noreply.github.com>
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.
Matrix-ize lint/build across ubuntu+windows, add a unit job that runs the bun:test suite on both OSes (previously not in CI at all), and add a focused windows-qmd-smoke job that:
Gives us a runnable signal for PR #11 before merging it.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.