Skip to content

Commit

Permalink
Merge pull request #66 from torusresearch/fix/lib-packaging
Browse files Browse the repository at this point in the history
package dkls types with client lib
  • Loading branch information
metalurgical authored Jul 8, 2024
2 parents a474746 + 1330c46 commit bcb08ea
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 98 deletions.
82 changes: 5 additions & 77 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
"@toruslabs/torus-scripts": "^5.3.1",
"@types/elliptic": "^6.4.16",
"babel-loader": "^9.1.3",
"chromedriver": "^124.0.1",
"copy-webpack-plugin": "^11.0.0",
"chromedriver": "^126.0.1",
"find-process": "^1.4.7",
"husky": "^8.0.3",
"lerna": "^8.0.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/tss-client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class Client {

public websocketOnly: boolean;

public tssLib: TssLib;
public tssLib: typeof TssLib;

public _startPrecomputeTime: number;

Expand Down Expand Up @@ -154,7 +154,7 @@ export class Client {
_share: string,
_pubKey: string,
_websocketOnly: boolean,
_tssLib: TssLib
_tssLib: typeof TssLib
) {
if (_parties.length !== _sockets.length) {
throw new Error("parties and sockets length must be equal, add null for client if necessary");
Expand Down
3 changes: 2 additions & 1 deletion packages/tss-client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"extends": "../../tsconfig.json"
"extends": "../../tsconfig.json",
"include": ["./src/**/*"],
}
2 changes: 1 addition & 1 deletion packages/tss-lib/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["../../.eslintrc"],
"extends": ["../../.eslintrc.js"],
"parserOptions": {
"project": "./tsconfig.json"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/tss-lib/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as lib from "./pkg";
import * as lib from "./pkg/dkls";
import wasmDataURL from "./pkg/dkls_bg.wasm";

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
3 changes: 1 addition & 2 deletions packages/tss-lib/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"extends": "../../tsconfig.json",
"exclude": ["*.d.ts"],
"include": ["./src/**/*.ts"]
"include": ["./src/*"],
}
9 changes: 0 additions & 9 deletions packages/tss-lib/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
const CopyPlugin = require("copy-webpack-plugin");

const cfg = {
plugins: [
new CopyPlugin({
patterns: [
{ from: "src/pkg/dkls.d.ts", to: "types/dkls.d.ts" }
]
})
],
module: {
rules: [
{
Expand Down
1 change: 0 additions & 1 deletion packages/web-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"@types/jsrsasign": "^10.5.12",
"assert": "^2.0.0",
"buffer": "^6.0.3",
"copy-webpack-plugin": "^11.0.0",
"crypto-browserify": "^3.12.0",
"html-webpack-plugin": "^5.5.0",
"https-browserify": "^1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/web-example/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const path = require("path");
const webpack = require("webpack");

const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require("copy-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");

/** @type {import("webpack").Configuration} */
module.exports = {
entry: process.env.NODE_ENV === "local" || process.env.NODE_ENV === "development" || process.env.NODE_ENV === "testing" ? "./src/local.ts" : "./src/prod.ts",
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "@toruslabs/config/tsconfig.default.json",
"compilerOptions": {
"baseUrl": "./",
"allowJs": true,
"paths": {
"@toruslabs/*": ["packages/tss-*"]
}
Expand Down

0 comments on commit bcb08ea

Please sign in to comment.