Skip to content

Commit 98336ce

Browse files
committed
fix(ts-sdk): simplify
1 parent 5d93dd1 commit 98336ce

File tree

8 files changed

+73
-30
lines changed

8 files changed

+73
-30
lines changed

ts-sdk/package.json

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
{
22
"name": "@unionlabs/sdk",
3-
"version": "1.0.1",
4-
"main": "index.js",
3+
"version": "1.0.5",
4+
"type": "module",
5+
"license": "MIT",
6+
"author": "@unionlabs",
57
"scripts": {
6-
"build": "tsup",
8+
"build": "tsc",
79
"test": "vitest run",
810
"test-watch": "vitest"
911
},
10-
"files": ["./src", "./dist"],
11-
"keywords": [],
12-
"author": "",
13-
"license": "MIT",
14-
"description": "",
12+
"exports": {
13+
".": "./dist/src/index.js",
14+
"./evm": "./dist/src/evm/index.js"
15+
},
16+
"files": [
17+
"package.json",
18+
"README.md",
19+
"src/**/*.ts",
20+
"dist/**/*.js",
21+
"dist/**/*.js.map",
22+
"dist/**/*.d.ts",
23+
"dist/**/*.d.ts.map"
24+
],
1525
"devDependencies": {
1626
"biome": "^0.3.3",
1727
"tsup": "^8.4.0",

ts-sdk/src/evm/abi/ucs03.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,4 +616,4 @@ export const ucs03abi = [
616616
name: "UUPSUnsupportedProxiableUUID",
617617
inputs: [{ name: "slot", type: "bytes32", internalType: "bytes32" }]
618618
}
619-
]
619+
] as const

ts-sdk/src/evm/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
// Re-export all EVM-related modules
2-
export * as abi from "./abi"
1+
export * as abi from "./abi/index.js"

ts-sdk/src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1+
export * as evm from "./evm/index.js"
2+
13
export function greet(name: string): string {
24
return `Hello, ${name}!`
35
}
4-
5-
// Export EVM module
6-
export * as evm from "./evm"

ts-sdk/test/evm.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, it, expect } from "vitest"
2-
import { ucs03abi } from "../src/evm/abi/index.ts"
2+
import { ucs03abi } from "../src/evm/abi/index.js"
33

44
describe("abi", () => {
55
it("should export ucs03abi", () => {

ts-sdk/test/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, it } from "vitest"
2-
import { greet } from "../src/index.ts"
2+
import { greet } from "../src/index.js"
33

44
describe("greet", () => {
55
it("should return a greeting message", () => {

ts-sdk/tsconfig.json

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,51 @@
1+
// source: https://2ality.com/2025/01/tsconfig-json.html#summary
12
{
3+
"include": [
4+
"src/**/*",
5+
"test/**/*"
6+
],
27
"compilerOptions": {
8+
// Specified explicitly (not derived from source file paths)
9+
"rootDir": ".",
310
"outDir": "dist",
4-
"module": "ESNext",
5-
"target": "ES2021",
6-
"moduleResolution": "bundler",
7-
"declaration": true,
8-
"declarationMap": true,
9-
"sourceMap": true,
10-
"strict": true,
11-
"esModuleInterop": true,
12-
"allowSyntheticDefaultImports": true
13-
},
14-
"include": ["src"],
15-
"exclude": ["node_modules", "dist", "test"]
16-
}
11+
//========== Output: JavaScript ==========
12+
"target": "ES2024",
13+
"lib": [
14+
"ES2024"
15+
], // remove if you want to use the DOM
16+
"skipLibCheck": true,
17+
"module": "NodeNext", // sets up "moduleResolution"
18+
// Emptily imported modules must exist
19+
"noUncheckedSideEffectImports": true,
20+
"sourceMap": true, // .js.map files
21+
//========== Compiling TS with tools other than tsc ==========
22+
//----- Emitting .js -----
23+
// Enforces keyword `type` for type imports etc.
24+
"verbatimModuleSyntax": true, // implies "isolatedModules"
25+
// - Forbids non-JavaScript language constructs such as JSX,
26+
// enums, constructor parameter properties and namespaces
27+
// - Important for type stripping
28+
"erasableSyntaxOnly": true, // TS 5.8+
29+
//----- Emitting .d.ts -----
30+
// - Enforces constraints that enable efficient .d.ts generation:
31+
// no inferred return types of exported functions etc.
32+
// - Even though this option would be generally useful, it requires
33+
// that `declaration` or `composite` is true.
34+
"isolatedDeclarations": true,
35+
//========== Type checking ==========
36+
"strict": true, // activates several useful options
37+
"exactOptionalPropertyTypes": true, // remove if not helpful
38+
"noFallthroughCasesInSwitch": true,
39+
"noImplicitOverride": true,
40+
"noImplicitReturns": true,
41+
"noPropertyAccessFromIndexSignature": true,
42+
"noUncheckedIndexedAccess": true,
43+
//========== Non-code artifacts ==========
44+
// Lets us import JSON files
45+
"resolveJsonModule": true,
46+
//===== Output: declarations =====
47+
"declaration": true, // .d.ts files
48+
// “Go to definition” jumps to TS source etc.
49+
"declarationMap": true // .d.ts.map files
50+
}
51+
}

ts-sdk/tsup.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { defineConfig } from "tsup"
22

33
export default defineConfig({
44
entry: ["src/index.ts"],
5-
format: ["cjs", "esm"],
5+
format: ["esm"],
66
dts: true,
77
splitting: true,
88
sourcemap: true,

0 commit comments

Comments
 (0)