Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix(client): resolve a11y guard imports with posix paths so it passes on Windows (#12351)

Adam Eivy7ecdcba43a9e
diff --git a/client/src/a11yConventions.test.js b/client/src/a11yConventions.test.js
index 377e954008..e42530644f 100644
--- a/client/src/a11yConventions.test.js
+++ b/client/src/a11yConventions.test.js
@@ -47,7 +47,7 @@
import { describe, it, expect } from 'vitest';
import { readFileSync } from 'fs';
-import { join, dirname } from 'path';
+import { join, dirname, posix } from 'path';
import { fileURLToPath } from 'url';
import { trackedJsxFiles as trackedJsx, trackedSourceFiles as trackedSources } from './test/trackedFiles.js';
import { escapeRegExp } from './lib/textUtils.js';
@@ -1384,9 +1384,11 @@ function wrapperShapes(body, params) {
// Resolve a relative import specifier to a client-relative path, the way the
// bundler would. Restricted to git-tracked sources for the same reason the scan
// is: an untracked scratch file must not be able to name a control either.
+// posix join: tracked paths come from `git ls-files` with `/` separators, and
+// win32 `join` would emit `\\` and never match them.
function resolveRelativeImport(fromFile, specifier) {
if (!specifier.startsWith('.')) return null;
- const base = join(dirname(fromFile), specifier);
+ const base = posix.join(posix.dirname(fromFile), specifier);
const candidates = [base, `${base}.jsx`, `${base}.js`, `${base}/index.jsx`, `${base}/index.js`];
// The virtual set is consulted without being folded into `trackedSourceSet()`
// — that Set is memoized for the whole suite, and seeding it would outlive