From 4dd12eda9c4fc34f7f0d53e6385d767500d39837 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Thu, 26 Mar 2026 12:13:09 +0100 Subject: [PATCH 1/3] Add CI workflow to build and test on PRs and pushes to main Runs npm ci + npm test across Node 18, 20, and 22 so we catch regressions and can evaluate dependabot PRs automatically. --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3cf83fa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18, 20, 22] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: npm + - run: npm ci + - run: npm test From 461876bf32de2066510f1a16877122533cd7b552 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Thu, 26 Mar 2026 12:37:42 +0100 Subject: [PATCH 2/3] Fix CI failures: correct test expectation whitespace, drop Node 18 - Fix expected import spacing in semantic-matching test (missing space after opening brace) - Remove Node 18 from CI matrix since dependencies require >=20 --- .github/workflows/ci.yml | 2 +- test/semantic-matching.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3cf83fa..e9293b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [18, 20, 22] + node-version: [20, 22] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 diff --git a/test/semantic-matching.test.ts b/test/semantic-matching.test.ts index b959183..d1c2a27 100644 --- a/test/semantic-matching.test.ts +++ b/test/semantic-matching.test.ts @@ -107,7 +107,7 @@ describe('SemanticForwardRefMigration (Section 5: Semantic Matching)', () => { const MyComponent = reactForwardRef(Component); `, ` - import {forwardRef, memo, forwardRef as reactForwardRef } from 'react'; + import { forwardRef, memo, forwardRef as reactForwardRef } from 'react'; const MyComponent = memo(forwardRef(Component)); ` // Note: Semantic matching FOUND it via the alias 'reactForwardRef' From 299e975b3e3a45ce4a962f397e2d785d7cb48921 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Thu, 26 Mar 2026 12:45:39 +0100 Subject: [PATCH 3/3] Increase test timeout for semantic-matching tests These tests use npm() which does package resolution on first run, causing the first test to exceed the default 5s timeout on slower CI runners. --- test/semantic-matching.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/semantic-matching.test.ts b/test/semantic-matching.test.ts index d1c2a27..fdd55ff 100644 --- a/test/semantic-matching.test.ts +++ b/test/semantic-matching.test.ts @@ -20,6 +20,8 @@ const REACT_PACKAGE_JSON = ` `; describe('SemanticForwardRefMigration (Section 5: Semantic Matching)', () => { + jest.setTimeout(30_000); + test('matches forwardRef with named import (merges into existing import)', async () => { const spec = new RecipeSpec(); spec.recipe = new SemanticForwardRefMigration();