Skip to content

Commit

Permalink
Fix typescript builds
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Mar 24, 2024
1 parent 27cde12 commit 9d75ce9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 25 deletions.
2 changes: 2 additions & 0 deletions src/_type_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ tx.addOutput({ amount: 123n });
// tx.addOutput({ amount: 123 });

for (let i = 0; i < tx.inputsLength; i++) {
// @ts-ignore
console.log('I', tx.getInput(i));
}

for (let i = 0; i < tx.outputsLength; i++) {
// @ts-ignore
console.log('O', tx.getOutput(i));
}
3 changes: 3 additions & 0 deletions src/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
21 changes: 3 additions & 18 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
{
"extends": "@paulmillr/jsbt/tsconfigs/esm.json",
"compilerOptions": {
"target": "es2020",
"lib": ["es2020"],
"strict": true,
"sourceMap": false,
"allowSyntheticDefaultImports": false,
"allowUnreachableCode": false,
"esModuleInterop": false,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUncheckedIndexedAccess": false,
"noUnusedLocals": true,
"noUnusedParameters": true,
"baseUrl": ".",

"module": "es2020",
"outDir": "lib/esm",
"moduleResolution": "bundler"
"outDir": "lib/esm"
},
"include": ["src"],
"include": ["index.ts", "src"],
"exclude": ["node_modules", "lib"]
}
12 changes: 5 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"extends": "./tsconfig.esm.json",
"extends": "@paulmillr/jsbt/tsconfigs/cjs.json",
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node10",
"outDir": "lib",
"declaration": true,
"declarationMap": true
}
"outDir": "lib"
},
"include": ["index.ts", "src"],
"exclude": ["node_modules", "lib"]
}

0 comments on commit 9d75ce9

Please sign in to comment.