Skip to content

CI: lint + test on ubuntu/windows (issue #6) - #12

Merged
heitorsDev merged 3 commits into
release/0.0.0from
feat/ci
Aug 9, 2026
Merged

heitorsDev merged 3 commits into
release/0.0.0from
feat/ci

Conversation

@heitorsDev

Copy link
Copy Markdown
Owner

Closes #6

Summary

  • .github/workflows/ci.yml — matrix ubuntu-latest + windows-latest,
    triggers on pull_request (any base) and push to release/**. Never
    on pull_request: closed — that's Release automation: create version on release/* → main merge #7's release-creation workflow, no
    overlap.
  • Steps: npm ci, npm run lint, npm test — both fail the build on
    error.
  • Added eslint as the repo's first devDependency (dev-only, never shipped
    — the installer/plugin runtime is still pure stdlib per ADR 0004/0005).
    Fixed the 2 real lint errors it found (missing globals in
    eslint.config.js, one genuinely unused import in a test file).
  • Zero network calls to api.anthropic.com — already true, the existing
    suite mocks fetch/fs at the true boundary.

Test plan

  • npm run lint and npm test both green locally.
  • This PR itself is the live verification this workflow needs (per the
    ticket's own TDD note — CI trigger behavior isn't unit-testable).
    Will confirm the Actions run goes green on both OSes once opened, then
    push one deliberately-broken commit to confirm it goes red, then
    revert before merging.

First dependency in the repo — dev-only, never shipped to end users
(the installer/plugin runtime stays pure stdlib per ADR 0004/0005).
Fixes the two lint errors it surfaced: missing Buffer/fetch globals
in eslint.config.js, and a genuinely unused import in
user-prompt-submit.test.js.
…ease/** (issue #6)

Matrix ubuntu-latest + windows-latest, per ADR 0005. No live calls to
Anthropic's usage endpoint (tests already mock fetch/fs). Triggers on
pull_request (any base) and push to release/** only — never on
pull_request:closed, which belongs entirely to #7's release-creation
workflow.
…CI (issue #6)

\`import.meta.url === \`file://\${process.argv[1]}\`\` never matches on
Windows: process.argv[1] is a backslash path (D:\a\...), but
import.meta.url is a properly-encoded file:// URL
(file:///D:/a/.../hook.js). Every hook.js/bin/install.js entrypoint
would have silently never run main() when actually invoked by Claude
Code on Windows — caught live by feat/ci's first PR run (Windows job
failed the installer's fresh-install seam with ENOENT, since
bin/install.js never wrote settings.json).

Fixed with pathToFileURL(process.argv[1]).href, which normalizes
separators/encoding correctly on both platforms — the standard Node
idiom for ESM main-module detection.
@heitorsDev

Copy link
Copy Markdown
Owner Author

Verification update: the workflow's first run on this PR (31291138849) went
red on Windows for real — it caught a genuine cross-platform bug (the
`import.meta.url === `file://${process.argv[1]}`` entrypoint guard never
matches on Windows path separators, so every hook.js/bin/install.js would
have silently never run when Claude Code actually invoked them on Windows).
Fixed in 3679b5e using `pathToFileURL`. Second run (31291262851) is green
on both ubuntu-latest and windows-latest.

That's a stronger red→green proof than a deliberately-broken test would
have been, so I'm treating that acceptance criterion as satisfied by this
organic catch rather than adding a synthetic break-and-revert.

@heitorsDev
heitorsDev merged commit bde1a2d into release/0.0.0 Aug 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant