Skip to content

Compile TypeScript to JavaScript before publishing to npm #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@
"email": "[email protected]"
},
"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": {
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
Loading