diff --git a/.github/workflows/compat.yml b/.github/workflows/compat.yml index ee7c4daa..b3987807 100644 --- a/.github/workflows/compat.yml +++ b/.github/workflows/compat.yml @@ -47,6 +47,13 @@ jobs: with: targets: ${{ matrix.runner == 'macos-latest' && 'aarch64-apple-ios-sim' || 'aarch64-linux-android' }} + - uses: actions/setup-node@v4 + with: + node-version: "20.x" + cache: "yarn" + - run: yarn install + - run: yarn build + - name: Generate & build turbo module run: | ./scripts/test-turbo-modules.sh \ diff --git a/package.json b/package.json index f721d6c3..c9509111 100644 --- a/package.json +++ b/package.json @@ -12,12 +12,15 @@ "email": "james@hugman.tv" }, "type": "module", - "main": "./typescript/src/index.ts", + "main": "./typescript/dist/index.js", + "types": "./typescript/dist/index.d.ts", "bin": { "ubrn": "./bin/cli.cjs", "uniffi-bindgen-react-native": "./bin/cli.cjs" }, "scripts": { + "build": "tsc", + "prepare": "yarn build", "test": "./scripts/run-tests.sh" }, "devDependencies": { diff --git a/tsconfig.json b/tsconfig.json index 69f5124f..040075e2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,8 @@ "uniffi-bindgen-react-native": ["./typescript/src/index"],/* Specify a set of entries that re-map imports to additional lookup locations. */ "@/*": ["./typescript/testing/*"], }, + "declaration": true, + "outDir": "./typescript/dist", /* Redirect output structure to the directory. */ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ "strict": true, /* Enable all strict type-checking options. */