Skip to content

Commit 92da4c0

Browse files
Merge pull request #63 from BitGo/BTC-0.vscodesettings
chore(wasm-utxo): fix vscode and compile settings
2 parents 025da4c + 5311005 commit 92da4c0

File tree

7 files changed

+32
-22
lines changed

7 files changed

+32
-22
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"makefile.configureOnOpen": false,
3+
"mochaExplorer.files": "test/**/*.ts",
4+
"mochaExplorer.logpanel": true,
5+
"mochaExplorer.esmLoader": true,
6+
"mochaExplorer.nodeArgv": ["--import=tsx/esm", "--experimental-wasm-modules"],
7+
"rust-analyzer.check.command": "clippy",
8+
"rust-analyzer.check.extraArgs": ["--", "-W", "clippy::all"]
9+
}

packages/wasm-utxo/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ endef
3838
js/wasm/:
3939
$(call BUILD,$@,bundler)
4040

41-
.PHONY: dist/esm/wasm/
42-
dist/esm/wasm/:
41+
.PHONY: dist/esm/js/wasm/
42+
dist/esm/js/wasm/:
4343
$(call BUILD,$@,bundler)
4444

45-
.PHONY: dist/cjs/wasm/
46-
dist/cjs/wasm/:
45+
.PHONY: dist/cjs/js/wasm/
46+
dist/cjs/js/wasm/:
4747
$(call BUILD,$@,nodejs)
4848

4949
.PHONY: lint

packages/wasm-utxo/bundler-test/test-cjs-import.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ console.log("Testing CommonJS require() compatibility...\n");
88
// Use standard CommonJS require
99
let wasmUtxo;
1010
try {
11-
wasmUtxo = require("../dist/cjs/index.js");
11+
wasmUtxo = require("../dist/cjs/js/index.js");
1212
} catch (error) {
1313
console.error("✗ require() failed:", error.message);
1414
process.exit(1);

packages/wasm-utxo/bundler-test/test-esm-import.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Run with: node --experimental-wasm-modules bundler-test/test-esm-import.mjs
44
*/
55

6-
import { Descriptor, Psbt, address, fixedScriptWallet } from "../dist/esm/index.js";
6+
import { Descriptor, Psbt, address, fixedScriptWallet } from "../dist/esm/js/index.js";
77

88
console.log("Testing ESM import...\n");
99

packages/wasm-utxo/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,32 @@
1515
"exports": {
1616
".": {
1717
"import": {
18-
"types": "./dist/esm/index.d.ts",
19-
"default": "./dist/esm/index.js"
18+
"types": "./dist/esm/js/index.d.ts",
19+
"default": "./dist/esm/js/index.js"
2020
},
2121
"require": {
22-
"types": "./dist/cjs/index.d.ts",
23-
"default": "./dist/cjs/index.js"
22+
"types": "./dist/cjs/js/index.d.ts",
23+
"default": "./dist/cjs/js/index.js"
2424
}
2525
}
2626
},
27-
"main": "./dist/cjs/index.js",
28-
"module": "./dist/esm/index.js",
29-
"types": "./dist/esm/index.d.ts",
27+
"main": "./dist/cjs/js/index.js",
28+
"module": "./dist/esm/js/index.js",
29+
"types": "./dist/esm/js/index.d.ts",
3030
"sideEffects": [
31-
"./dist/esm/wasm/wasm_utxo.js",
32-
"./dist/cjs/wasm/wasm_utxo.js"
31+
"./dist/esm/js/wasm/wasm_utxo.js",
32+
"./dist/cjs/js/wasm/wasm_utxo.js"
3333
],
3434
"scripts": {
35-
"test": "npm run test:mocha && npm run test:wasm-pack",
35+
"test": "npm run test:mocha && npm run test:wasm-pack && npm run test:imports",
3636
"test:mocha": "mocha --recursive test",
3737
"test:wasm-pack": "npm run test:wasm-pack-node && npm run test:wasm-pack-chrome",
3838
"test:wasm-pack-node": "wasm-pack test --node",
3939
"test:wasm-pack-chrome": "wasm-pack test --headless --chrome",
4040
"test:esm-import": "node --experimental-wasm-modules bundler-test/test-esm-import.mjs",
4141
"test:cjs-import": "node bundler-test/test-cjs-import.cjs",
4242
"test:imports": "npm run test:esm-import && npm run test:cjs-import",
43-
"build:wasm": "make js/wasm/ && make dist/esm/wasm/ && make dist/cjs/wasm/",
43+
"build:wasm": "make js/wasm/ && make dist/esm/js/wasm/ && make dist/cjs/js/wasm/",
4444
"build:ts-esm": "tsc",
4545
"build:ts-cjs": "tsc --project tsconfig.cjs.json",
4646
"build:ts": "npm run build:ts-esm && npm run build:ts-cjs",

packages/wasm-utxo/tsconfig.cjs.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"compilerOptions": {
44
"module": "CommonJS",
55
"moduleResolution": "node",
6-
"rootDir": "./js",
6+
"rootDir": ".",
77
"outDir": "./dist/cjs"
8-
}
8+
},
9+
"exclude": ["test/**/*"]
910
}

packages/wasm-utxo/tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
"skipLibCheck": true,
99
"declaration": true,
1010
"composite": true,
11-
"rootDir": "./js",
11+
"rootDir": ".",
1212
"outDir": "./dist/esm"
1313
},
14-
"include": ["./js/**/*.ts"],
15-
"exclude": ["node_modules", "./js/wasm/**/*", "test"]
14+
"include": ["./js/**/*.ts", "test/**/*.ts"],
15+
"exclude": ["node_modules", "./js/wasm/**/*"]
1616
}

0 commit comments

Comments
 (0)