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 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": { 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") {