diff --git a/JS-SDK/build.mjs b/JS-SDK/build.mjs deleted file mode 100644 index 9f65438..0000000 --- a/JS-SDK/build.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import dts from "bun-plugin-dts"; - -await Bun.build({ - entrypoints: ["./src/index.ts"], - outdir: "./dist", - minify: true, - plugins: [dts()], -}); diff --git a/JS-SDK/bun.lockb b/JS-SDK/bun.lockb index 993f7ca..59a3f68 100644 Binary files a/JS-SDK/bun.lockb and b/JS-SDK/bun.lockb differ diff --git a/JS-SDK/package.json b/JS-SDK/package.json index a04bbb7..d9cd15e 100644 --- a/JS-SDK/package.json +++ b/JS-SDK/package.json @@ -19,7 +19,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "build": "bun run build.mjs", + "build": "tsup", "prepublishOnly": "bun run build" }, "files": [ @@ -29,7 +29,6 @@ "@types/bun": "latest", "@types/react": "^18.3.5", "@types/react-dom": "^18.3.0", - "bun-plugin-dts": "^0.2.2", "react": "^18.3.1", "react-dom": "18.3.1" }, @@ -37,5 +36,8 @@ "typescript": "^5.0.0", "react": "*", "react-dom": "*" + }, + "dependencies": { + "tsup": "^8.2.4" } } \ No newline at end of file diff --git a/JS-SDK/src/hook/websocket.ts b/JS-SDK/src/hook/websocket.ts index c23d646..f03f80a 100644 --- a/JS-SDK/src/hook/websocket.ts +++ b/JS-SDK/src/hook/websocket.ts @@ -12,9 +12,8 @@ export const useTetherWS = ( const [user] = useState(snowflake); useEffect(() => { - console.log("HELLO WORLD"); + console.log("HELLO WORLD", endpoint, secure); }, [snowflake]); return user; }; -export default useTetherWS; diff --git a/JS-SDK/tsconfig.json b/JS-SDK/tsconfig.json index 5abdb79..38b47fa 100644 --- a/JS-SDK/tsconfig.json +++ b/JS-SDK/tsconfig.json @@ -1,21 +1,37 @@ { - "compilerOptions": { - "target": "es2020", - "module": "esnext", - "strict": true, - "esModuleInterop": true, - "moduleResolution": "node", - "skipLibCheck": true, - "noUnusedLocals": true, - "noImplicitAny": true, - "allowJs": true, - "noEmit": true, - "outDir": "dist", - "resolveJsonModule": true, - "paths": { - "@/*": ["./src/*"], - "@/lib/*": ["./src/lib/*"], - "@/types/*": ["./src/types/*"] - } - } -} + "compilerOptions": { + "module": "esnext", + "lib": [ + "dom", + "esnext" + ], + "target": "ESNext", + "moduleResolution": "node", + "jsx": "react", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "useUnknownInCatchVariables": true, + "noImplicitOverride": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "exactOptionalPropertyTypes": true, + "noImplicitReturns": true, + "noUncheckedIndexedAccess": true, + "paths": { + "@/*": [ + "./src/*" + ], + "@/lib/*": [ + "./src/lib/*" + ], + "@/types/*": [ + "./src/types/*" + ] + } + }, + "include": [ + "src" + ] +} \ No newline at end of file diff --git a/JS-SDK/tsup.config.ts b/JS-SDK/tsup.config.ts new file mode 100644 index 0000000..07458f1 --- /dev/null +++ b/JS-SDK/tsup.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["./src/index.ts"], + format: ["cjs", "esm"], + dts: true, + target: "node20", + sourcemap: true, + minify: true, + publicDir: "build", + clean: true, +});