Skip to content

Commit eeec514

Browse files
committed
Compile TypeScript to JavaScript before publishing to npm
1 parent 93aa185 commit eeec514

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ target/
55

66
# Generated by Typescript
77
dist/
8+
lib/
89

910
# For cpp
1011
cpp_modules/

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@
1212
"email": "[email protected]"
1313
},
1414
"type": "module",
15-
"main": "./typescript/src/index.ts",
15+
"main": "./lib/index.js",
16+
"types": "./lib/index.d.ts",
1617
"bin": {
1718
"ubrn": "./bin/cli.cjs",
1819
"uniffi-bindgen-react-native": "./bin/cli.cjs"
1920
},
2021
"scripts": {
22+
"build": "tsc",
23+
"prepare": "yarn build",
2124
"test": "./scripts/run-tests.sh"
2225
},
2326
"devDependencies": {

tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"uniffi-bindgen-react-native": ["./typescript/src/index"],/* Specify a set of entries that re-map imports to additional lookup locations. */
77
"@/*": ["./typescript/testing/*"],
88
},
9+
"declaration": true,
10+
"outDir": "./lib", /* Redirect output structure to the directory. */
911
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
1012
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
1113
"strict": true, /* Enable all strict type-checking options. */

0 commit comments

Comments
 (0)