From 1892b059efe6674ac1f4913906e2bb50baf24d67 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Tue, 8 Sep 2026 11:37:57 +0200 Subject: [PATCH 1/3] ci: run unit tests on windows --- .github/workflows/check-project.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-project.yml b/.github/workflows/check-project.yml index 7e7d2d08b..e4c44ac32 100644 --- a/.github/workflows/check-project.yml +++ b/.github/workflows/check-project.yml @@ -28,8 +28,20 @@ jobs: - name: Typecheck run: yarn typecheck - - name: Test - run: yarn test - - name: Build packages run: yarn lerna run prepare + + test: + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + + - name: Setup + uses: ./.github/actions/setup + + - name: Test + run: yarn test From 0ce799d52089c18ddbc1600739a057fc7aa8bc99 Mon Sep 17 00:00:00 2001 From: Kallinikos Milonakis <95851621+KallinikosMil@users.noreply.github.com> Date: Tue, 8 Sep 2026 12:40:01 +0300 Subject: [PATCH 2/3] fix(init): use posix separators for the paths written into package.json (#953) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Running `bob init` on Windows writes backslashes into `package.json`: ```json { "main": "./lib\module\index.js", "types": "./lib\typescript\src\index.d.ts", "exports": { ".": { "types": "./lib\typescript\src\index.d.ts", "default": "./lib\module\index.js" } } } ``` `main`, `module`, `types` and `exports` are **module specifiers**, not filesystem paths — they're always forward-slashed regardless of platform. `main` and `types` are lenient enough that some tooling still copes, but `exports` is matched as a literal string by Node's resolver, so a library initialised on Windows ships a manifest whose entry points don't resolve. The values are built by interpolating `path.join` into a `./…` template: ```ts entries.module = `./${path.join(output, 'module', 'index.js')}`; ``` `path.join` is correct for touching the filesystem and wrong for producing a specifier. Since these are always relative and always forward-slashed, `path.posix.join` is the right join — five call sites, all feeding the same `entries` / `types` objects that `main`, `module`, `types` and `exports` are later derived from. This is the same class of bug as [callstack/react-native-paper#5054](https://github.com/callstack/react-native-paper/pull/5054), where a platform-native path reached an import specifier. ## Test plan Windows 11, Node 22.23.2, yarn 4.11.0. `src/__tests__/init.test.ts` already covers this — the committed snapshot encodes the correct forward-slash output, so on Windows it fails on `main` today: **Before** ``` ❯ src/__tests__/init.test.ts (1 test | 1 failed) × initializes the configuration - "main": "./lib/module/index.js", + "main": "./lib\module\index.js", ``` **After** — passes, **without the snapshot being regenerated**. The only file in the diff is `init.ts`; the snapshot is untouched, which is the point: the fix makes Windows produce exactly the output Linux and macOS already produce. `yarn lint` and `yarn typecheck` are both clean, and the lefthook pre-commit (eslint + tsc) passed. ### One thing that is *not* fixed here, and isn't yours Two cases in `typescript.test.ts` still fail on my machine: ``` Error: EPERM: operation not permitted, symlink '…\bob-typescript-SA8Uzm' -> '…\consumer\node_modules\library' ``` That's a local privilege limitation, not a bug in this repo — Windows only allows `fs.symlink` with Developer Mode enabled or elevation, and I confirmed Developer Mode is off here (`AllowDevelopmentWithoutDevLicense` unset) and that a bare `fs.symlinkSync` fails the same way outside the repo entirely. I'm mentioning it only so the number of failing tests in the "before" output isn't confusing; I haven't touched those tests. Worth noting the `os` matrices in `build-local-libraries.yml` and `build-templates.yml` are `[ubuntu-latest, macos-latest]`, which is why this hasn't surfaced. Happy to add `windows-latest` in a separate PR if you'd like the coverage — I didn't want to spend your CI minutes without asking. --------- Co-authored-by: Satyajit Sahoo --- packages/react-native-builder-bob/src/init.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/react-native-builder-bob/src/init.ts b/packages/react-native-builder-bob/src/init.ts index fe363f78d..434eef924 100644 --- a/packages/react-native-builder-bob/src/init.ts +++ b/packages/react-native-builder-bob/src/init.ts @@ -157,11 +157,11 @@ export async function init() { if (targets.includes('module')) { esm = true; - entries.module = `./${path.join(output, 'module', 'index.js')}`; + entries.module = `./${path.posix.join(output, 'module', 'index.js')}`; } if (targets.includes('commonjs')) { - entries.commonjs = `./${path.join(output, 'commonjs', 'index.js')}`; + entries.commonjs = `./${path.posix.join(output, 'commonjs', 'index.js')}`; } const types: { @@ -170,7 +170,7 @@ export async function init() { if (targets.includes('typescript')) { if (targets.includes('commonjs') && targets.includes('module')) { - types.require = `./${path.join( + types.require = `./${path.posix.join( output, 'typescript', 'commonjs', @@ -178,7 +178,7 @@ export async function init() { 'index.d.ts' )}`; - types.import = `./${path.join( + types.import = `./${path.posix.join( output, 'typescript', 'module', @@ -186,7 +186,7 @@ export async function init() { 'index.d.ts' )}`; } else { - types.require = `./${path.join( + types.require = `./${path.posix.join( output, 'typescript', source, From 86088cb7da55f40ac1d9d31bd643815681ded6fa Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Tue, 8 Sep 2026 11:45:48 +0200 Subject: [PATCH 3/3] chore: add .gitattributes for windows --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..f6a525dbc --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +* text=auto eol=lf +*.bat text eol=crlf +*.cmd text eol=crlf