From 236f3dac746e003b5eb2bb453273feccbbf6cdea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 11 Jun 2025 19:02:07 +0200 Subject: [PATCH 1/3] Run everything on all platforms --- .github/workflows/check.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 16769e0a..609c0eab 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -18,22 +18,12 @@ jobs: node-version: lts/jod - run: npm ci - run: npm run lint - simple-tests: + test: strategy: matrix: - runner: [ubuntu-latest, windows-latest] - name: Run simple tests (${{ matrix.runner }}) + runner: [ubuntu-latest, windows-latest, macos-latest] + name: Test (${{ matrix.runner }}) runs-on: ${{ matrix.runner }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: lts/jod - - run: npm ci - - run: npx nx run-many -t test --exclude @react-native-node-api/node-addon-examples - macos-tests: - name: Run tests which requires MacOS - runs-on: macos-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 From ebf1fffdcb0a1c38577e2aa2e271679f04bce47b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 11 Jun 2025 19:05:15 +0200 Subject: [PATCH 2/3] Fix cross-platform issue when copying examples --- packages/node-addon-examples/scripts/cmake-projects.mts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/node-addon-examples/scripts/cmake-projects.mts b/packages/node-addon-examples/scripts/cmake-projects.mts index a37a84d4..a9d605f3 100644 --- a/packages/node-addon-examples/scripts/cmake-projects.mts +++ b/packages/node-addon-examples/scripts/cmake-projects.mts @@ -1,14 +1,14 @@ import { readdirSync, statSync } from "node:fs"; -import { join } from "node:path"; +import path from "node:path"; -export const EXAMPLES_DIR = new URL("../examples", import.meta.url).pathname; +export const EXAMPLES_DIR = path.resolve(import.meta.dirname, "../examples"); export function findCMakeProjects(dir = EXAMPLES_DIR): string[] { let results: string[] = []; const files = readdirSync(dir); for (const file of files) { - const fullPath = join(dir, file); + const fullPath = path.join(dir, file); if (statSync(fullPath).isDirectory()) { results = results.concat(findCMakeProjects(fullPath)); } else if (file === "CMakeLists.txt") { From 0cdaa404a89b5825d3e619df8dc9b025f938a733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 11 Jun 2025 19:05:34 +0200 Subject: [PATCH 3/3] Explicit package type --- packages/node-addon-examples/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/node-addon-examples/package.json b/packages/node-addon-examples/package.json index ccd386fb..2153e633 100644 --- a/packages/node-addon-examples/package.json +++ b/packages/node-addon-examples/package.json @@ -1,5 +1,6 @@ { "name": "@react-native-node-api/node-addon-examples", + "type": "commonjs", "private": true, "homepage": "https://github.com/callstackincubator/react-native-node-api", "repository": {