Skip to content

Commit 2dd3dc6

Browse files
committed
added yarn rc, fixing imports
1 parent e2fad1b commit 2dd3dc6

File tree

11 files changed

+6250
-3415
lines changed

11 files changed

+6250
-3415
lines changed

.yarn/install-state.gz

695 KB
Binary file not shown.

.yarn/releases/yarn-4.6.0.cjs

Lines changed: 934 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nodeLinker: node-modules
2+
3+
yarnPath: .yarn/releases/yarn-4.6.0.cjs

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
"wasm:cp": "We need to copy wasm to the dist folder, so it can be imported correctly"
1313
},
1414
"scripts": {
15-
"prepublish": "yarn workspaces focus @namada/sdk && yarn build",
15+
"prepublish": "yarn build",
1616
"prebuild": "rimraf ./dist",
1717
"wasm:cp": "node ./scripts/copy.js",
18-
"build:web": "yarn wasm:build && tspc -p tsconfig.web.json && yarn wasm:cp",
19-
"build:node": "yarn wasm:build:node && tspc -p tsconfig.node.json && yarn wasm:node:cp",
20-
"build": "yarn prebuild && yarn build:web && yarn build:node",
18+
"build:web": "yarn wasm:build && tspc -p tsconfig.web.json",
19+
"build:node": "yarn wasm:build:node && tspc -p tsconfig.node.json",
20+
"build": "yarn prebuild && yarn build:web && yarn build:node && yarn wasm:cp",
2121
"wasm:check": "cd ./lib && cargo check && cargo clippy",
2222
"wasm:ts:node": "tsc -p tsconfig.node.json",
2323
"wasm:ts:web": "tsc -p tsconfig.web.json",
@@ -26,7 +26,6 @@
2626
"wasm:build:dev": "yarn wasm:ts:web && node ./scripts/build.js",
2727
"wasm:build:dev:multicore": "yarn wasm:ts:web && node ./scripts/build.js --multicore",
2828
"wasm:build:node": "yarn wasm:ts:node && node ./scripts/build.js --target nodejs --release",
29-
"test-wasm:ci": "yarn wasm:ts:node && cd ./lib && RUSTFLAGS='--cfg getrandom_backend=\"wasm_js\"' wasm-pack test --node -- --features nodejs --no-default-features",
3029
"wasm:build:node:multicore": "yarn wasm:ts:node && node ./scripts/build.js --target nodejs --release --multicore",
3130
"wasm:build:node:dev": "yarn wasm:ts:node && node ./scripts/build.js --target nodejs",
3231
"wasm:build:node:dev:multicore": "yarn wasm:ts:node && node ./scripts/build.js --target nodejs --multicore",
@@ -36,6 +35,7 @@
3635
"test:only": "yarn jest",
3736
"test:cov": "yarn wasm:build:node:dev && yarn jest --coverage",
3837
"test:watch": "yarn wasm:build:node:dev && yarn jest --watchAll=true",
38+
"test-wasm:ci": "yarn wasm:ts:node && cd ./lib && RUSTFLAGS='--cfg getrandom_backend=\"wasm_js\"' wasm-pack test --node -- --features nodejs --no-default-features",
3939
"test:ci": "jest"
4040
},
4141
"dependencies": {
@@ -60,10 +60,12 @@
6060
"jest": "^29.7.0",
6161
"rimraf": "^5.0.5",
6262
"ts-jest": "^29.2.5",
63+
"ts-macros": "^2.6.2",
6364
"ts-node": "^10.9.1",
6465
"typedoc": "^0.25.12",
6566
"typedoc-plugin-markdown": "^3.17.1",
6667
"typescript": "5.5.4",
68+
"typescript-transform-paths": "^3.4.7",
6769
"wasm-pack": "^0.13.0"
6870
},
6971
"files": [

src/ledger.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ import { makeBip44Path, makeSaplingPath } from "./utils";
1515

1616
import { NAMADA_COIN_TYPE as coinType } from "types";
1717

18+
// TODO: Fix this!
19+
type USBDevice = unknown;
20+
1821
export type LedgerAddressAndPublicKey = { address: string; publicKey: string };
1922
export type LedgerViewingKey = {
2023
xfvk: Uint8Array;

src/types/schema/revealPk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { field } from "@dao-xyz/borsh";
2-
import { RevealPkProps } from "../../tx/types";
2+
import { RevealPkProps } from "../types";
33

44
export class RevealPkMsgValue {
55
@field({ type: "string" })

src/wasm/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TxType } from "./web/sdk";
1+
import { TxType } from "./target/web/sdk";
22

33
export type SupportedTx = Extract<
44
TxType,

tsconfig.json

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
{
22
"compilerOptions": {
33
"allowJs": true,
4+
"allowSyntheticDefaultImports": true,
45
"baseUrl": "./src",
5-
"rootDir": "./src",
6-
"outDir": "./dist/",
76
"esModuleInterop": true,
87
"experimentalDecorators": true,
98
"forceConsistentCasingInFileNames": true,
109
"isolatedModules": true,
11-
"lib": ["dom", "dom.iterable", "esnext"],
10+
// "dom" is needed for WebAssembly typings
11+
"lib": ["esnext", "dom"],
1212
"module": "esnext",
13-
"moduleResolution": "node",
13+
"moduleResolution": "bundler",
14+
"noEmit": false,
1415
"noFallthroughCasesInSwitch": true,
1516
"resolveJsonModule": true,
1617
"skipLibCheck": true,
18+
"sourceMap": true,
1719
"strict": true,
18-
"target": "es2015",
19-
"types": ["node", "jest"],
20-
"declaration": true
20+
"target": "es2015"
2121
},
22-
//TODO: remove .eslintrc after fixing lintstaged
23-
"include": ["src", ".eslintrc.js"],
24-
"typeRoots": ["./node_modules/@types", "./src/types"]
22+
"include": ["src/**/*.ts", "examples/**/*.ts"],
23+
"exclude": ["node_modules"],
24+
"typeRoots": ["./node_modules/@types"],
25+
"ts-node": {
26+
"compilerOptions": {
27+
"module": "commonjs"
28+
}
29+
}
2530
}

tsconfig.node.json

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
{
2-
"include": ["lib/src/**/*.ts"],
2+
"extends": "./tsconfig.json",
3+
"include": [
4+
"./src/**/*.ts"
5+
],
6+
"exclude": [
7+
"./src/tests/*",
8+
"node_modules",
9+
"scripts"
10+
],
311
"compilerOptions": {
4-
"esModuleInterop": true,
12+
"declaration": true,
13+
"outDir": "dist/node",
514
"module": "node16",
615
"moduleResolution": "node16",
7-
"allowJs": false,
8-
"skipLibCheck": true,
9-
"noEmit": false,
10-
"declaration": false
16+
"plugins": [
17+
// Transform paths in output .js files
18+
{ "transform": "typescript-transform-paths" },
19+
20+
// Transform paths in output .d.ts files (Include this line if you output declarations files)
21+
{ "transform": "typescript-transform-paths", "afterDeclarations": true }
22+
]
1123
}
1224
}

tsconfig.web.json

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
{
2-
"include": ["lib/src/**/*.ts"],
2+
"extends": "./tsconfig.json",
3+
"include": [
4+
"./src/**/*"
5+
],
6+
"exclude": [
7+
"./src/tests/*.ts",
8+
"node_modules",
9+
"scripts"
10+
],
311
"compilerOptions": {
4-
"esModuleInterop": true,
12+
"declaration": true,
13+
"outDir": "dist/web",
514
"module": "esnext",
615
"moduleResolution": "bundler",
7-
"allowJs": false,
8-
"skipLibCheck": true,
9-
"noEmit": false,
10-
"declaration": false
16+
"plugins": [
17+
// Transform paths in output .js files
18+
{ "transform": "typescript-transform-paths" },
19+
20+
// Transform paths in output .d.ts files (Include this line if you output declarations files)
21+
{ "transform": "typescript-transform-paths", "afterDeclarations": true }
22+
]
1123
}
1224
}

0 commit comments

Comments
 (0)