From 974e33138550866f5a032aff2343d7a92c3c74d1 Mon Sep 17 00:00:00 2001
From: Charles <168678941+charlesw-salesforce@users.noreply.github.com>
Date: Mon, 11 May 2026 12:24:03 -0700
Subject: [PATCH 1/5] fix: use explicit module augmentation for vitest-axe
types (#13)
Replace /// with an
explicit declare module augmentation to fix TypeScript build failures
on Windows where the reference directive fails to resolve.
---
.../uiBundles/reactRecipes/vitest-env.d.ts | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts b/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts
index a7adb2d..458c701 100644
--- a/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts
+++ b/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts
@@ -1,4 +1,12 @@
///
///
///
-///
+
+import type { AxeMatchers } from 'vitest-axe/matchers';
+
+declare module 'vitest' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
+ interface Assertion extends AxeMatchers {}
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
+ interface AsymmetricMatchersContaining extends AxeMatchers {}
+}
From 0af04bd215c0066109b11c8fb47fb1303a1662c8 Mon Sep 17 00:00:00 2001
From: Charles <168678941+charlesw-salesforce@users.noreply.github.com>
Date: Mon, 11 May 2026 14:17:58 -0700
Subject: [PATCH 2/5] fix: switch from @testing-library/jest-dom to
@testing-library/jest-dom/vitest (#13)
---
.../uiBundles/reactRecipes/vitest-env.d.ts | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts b/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts
index 458c701..d7bd9d1 100644
--- a/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts
+++ b/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts
@@ -1,12 +1,4 @@
///
-///
+///
///
-
-import type { AxeMatchers } from 'vitest-axe/matchers';
-
-declare module 'vitest' {
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
- interface Assertion extends AxeMatchers {}
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
- interface AsymmetricMatchersContaining extends AxeMatchers {}
-}
+///
From c0ccea343451d91e58fd97ff3425b8152e4d344e Mon Sep 17 00:00:00 2001
From: Charles <168678941+charlesw-salesforce@users.noreply.github.com>
Date: Mon, 11 May 2026 15:37:52 -0700
Subject: [PATCH 3/5] fix: use explicit module augmentation for vitest-axe
types (#13)
Replace /// directives with import statements for
cross-platform compatibility. Add Windows CI job to catch platform-
specific type resolution issues.
---
.github/workflows/ci-pr.yml | 25 +++++++++++++++++++
.github/workflows/ci.yml | 24 ++++++++++++++++++
.../uiBundles/reactRecipes/vitest-env.d.ts | 8 +++---
3 files changed, 53 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml
index 890bd62..7d88b79 100644
--- a/.github/workflows/ci-pr.yml
+++ b/.github/workflows/ci-pr.yml
@@ -155,6 +155,31 @@ jobs:
echo One of more Code Analyzer critical or high severity violations found
exit 1
+ windows-build:
+ if: github.actor != 'trailheadapps-bot'
+ runs-on: windows-latest
+ steps:
+ - name: "Checkout source code"
+ uses: actions/checkout@v4
+
+ - name: "Setup Node"
+ uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: npm
+ cache-dependency-path: force-app/main/react-recipes/uiBundles/reactRecipes/package-lock.json
+
+ - name: "Install React app dependencies"
+ run: npm ci --prefix force-app/main/react-recipes/uiBundles/reactRecipes
+
+ - name: "Build"
+ run: npm run build
+ working-directory: force-app/main/react-recipes/uiBundles/reactRecipes
+
+ - name: "Test"
+ run: npx vitest --run
+ working-directory: force-app/main/react-recipes/uiBundles/reactRecipes
+
scratch-org-test:
runs-on: trailheadapps-Ubuntu
if: github.actor != 'dependabot[bot]'
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d7de9fc..c1deab7 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -138,6 +138,30 @@ jobs:
echo One of more Code Analyzer critical or high severity violations found
exit 1
+ windows-build:
+ runs-on: windows-latest
+ steps:
+ - name: "Checkout source code"
+ uses: actions/checkout@v4
+
+ - name: "Setup Node"
+ uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: npm
+ cache-dependency-path: force-app/main/react-recipes/uiBundles/reactRecipes/package-lock.json
+
+ - name: "Install React app dependencies"
+ run: npm ci --prefix force-app/main/react-recipes/uiBundles/reactRecipes
+
+ - name: "Build"
+ run: npm run build
+ working-directory: force-app/main/react-recipes/uiBundles/reactRecipes
+
+ - name: "Test"
+ run: npx vitest --run
+ working-directory: force-app/main/react-recipes/uiBundles/reactRecipes
+
scratch-org-test:
runs-on: trailheadapps-Ubuntu
if: github.actor != 'dependabot[bot]'
diff --git a/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts b/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts
index d7bd9d1..6b97596 100644
--- a/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts
+++ b/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts
@@ -1,4 +1,4 @@
-///
-///
-///
-///
+import 'vitest';
+import 'vitest/globals';
+import '@testing-library/jest-dom';
+import 'vitest-axe/extend-expect';
From 12041628252acd3326cbf708eef026a887b53575 Mon Sep 17 00:00:00 2001
From: Charles <168678941+charlesw-salesforce@users.noreply.github.com>
Date: Mon, 11 May 2026 15:51:19 -0700
Subject: [PATCH 4/5] test: revert vitest-env.d.ts to original reference
directives to test Windows CI
---
.../react-recipes/uiBundles/reactRecipes/vitest-env.d.ts | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts b/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts
index 6b97596..a7adb2d 100644
--- a/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts
+++ b/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts
@@ -1,4 +1,4 @@
-import 'vitest';
-import 'vitest/globals';
-import '@testing-library/jest-dom';
-import 'vitest-axe/extend-expect';
+///
+///
+///
+///
From 190ca8c090fa834d498e30390dd0b365a24558fc Mon Sep 17 00:00:00 2001
From: Charles <168678941+charlesw-salesforce@users.noreply.github.com>
Date: Tue, 12 May 2026 08:44:36 -0700
Subject: [PATCH 5/5] fix: use imports instead of reference directives for type
augmentation (#13)
---
.../react-recipes/uiBundles/reactRecipes/vitest-env.d.ts | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts b/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts
index a7adb2d..6b97596 100644
--- a/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts
+++ b/force-app/main/react-recipes/uiBundles/reactRecipes/vitest-env.d.ts
@@ -1,4 +1,4 @@
-///
-///
-///
-///
+import 'vitest';
+import 'vitest/globals';
+import '@testing-library/jest-dom';
+import 'vitest-axe/extend-expect';