diff --git a/package-lock.json b/package-lock.json index de72a18..c498f1d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,14 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@sentry/types": "^7.12.1", "@toruslabs/customauth": "^10.1.0", "oidc-client-ts": "^2.0.5", "typescript-declaration-webpack-plugin": "^0.2.2", "web3": "^1.7.5" }, "devDependencies": { + "@types/elliptic": "^6.4.14", "@types/jest": "^28.1.6", "@types/node": "^18.7.6", "@types/webpack": "^5.28.0", @@ -1835,6 +1837,14 @@ "read-package-json-fast": "^2.0.1" } }, + "node_modules/@sentry/types": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.12.1.tgz", + "integrity": "sha512-VGZs39SZgMcCGv7H0VyFy1LEFGsnFZH590JUopmz6nG63EpeYQ2xzhIoPNAiLKbyUvBEwukn+faCg3u3MGqhgQ==", + "engines": { + "node": ">=8" + } + }, "node_modules/@sinclair/typebox": { "version": "0.24.28", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.28.tgz", @@ -2098,6 +2108,15 @@ "@types/responselike": "*" } }, + "node_modules/@types/elliptic": { + "version": "6.4.14", + "resolved": "https://registry.npmjs.org/@types/elliptic/-/elliptic-6.4.14.tgz", + "integrity": "sha512-z4OBcDAU0GVwDTuwJzQCiL6188QvZMkvoERgcVjq0/mPM8jCfdwZ3x5zQEVoL9WCAru3aG5wl3Z5Ww5wBWn7ZQ==", + "dev": true, + "dependencies": { + "@types/bn.js": "*" + } + }, "node_modules/@types/eslint": { "version": "8.4.5", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.5.tgz", @@ -17537,6 +17556,11 @@ "read-package-json-fast": "^2.0.1" } }, + "@sentry/types": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.12.1.tgz", + "integrity": "sha512-VGZs39SZgMcCGv7H0VyFy1LEFGsnFZH590JUopmz6nG63EpeYQ2xzhIoPNAiLKbyUvBEwukn+faCg3u3MGqhgQ==" + }, "@sinclair/typebox": { "version": "0.24.28", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.28.tgz", @@ -17738,6 +17762,15 @@ "@types/responselike": "*" } }, + "@types/elliptic": { + "version": "6.4.14", + "resolved": "https://registry.npmjs.org/@types/elliptic/-/elliptic-6.4.14.tgz", + "integrity": "sha512-z4OBcDAU0GVwDTuwJzQCiL6188QvZMkvoERgcVjq0/mPM8jCfdwZ3x5zQEVoL9WCAru3aG5wl3Z5Ww5wBWn7ZQ==", + "dev": true, + "requires": { + "@types/bn.js": "*" + } + }, "@types/eslint": { "version": "8.4.5", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.5.tgz", diff --git a/package.json b/package.json index 1ec8c1b..23859c3 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "scripts": { "type-check": "tsc --noEmit", "type-check:watch": "npm run type-check -- --watch", - "build:types": "tsc --emitDeclarationOnly", - "build": "rimraf ./dist && npm run build:js && build:types", + "build:types": "tsc -p tsconfig.build.json", + "build": "rimraf ./dist && npm run build:js && npm run build:types", "build:js": "webpack --mode=production --node-env=production", "build:dev": "webpack --mode=development", "build:prod": "webpack --mode=production --node-env=production", @@ -26,6 +26,8 @@ "web3": "^1.7.5" }, "devDependencies": { + "@sentry/types": "^7.12.1", + "@types/elliptic": "^6.4.14", "@types/jest": "^28.1.6", "@types/node": "^18.7.6", "@types/webpack": "^5.28.0", diff --git a/src/index.ts b/src/index.ts index e1edf80..3350422 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1 +1,9 @@ export { Client as THXClient } from './client'; +export { default as TorusManager } from './managers/TorusManager'; +export { default as CredentialManager } from './managers/CredentialManager'; +export { default as ERC20Manager } from './managers/ERC20Manager'; +export { default as ERC721Manager } from './managers/ERC721Manager'; +export { default as RequestManager } from './managers/RequestManager'; +export { default as AccountManager } from './managers/AccountManager'; +export { default as SessionManager } from './managers/SessionManager'; +export { default as UserManager } from './managers/UserManager'; diff --git a/src/managers/UserManager.ts b/src/managers/UserManager.ts index e366a5a..5cf1b3b 100644 --- a/src/managers/UserManager.ts +++ b/src/managers/UserManager.ts @@ -1,5 +1,6 @@ -import THXClient from '../client/Client'; import { UserManager as BaseUserManager } from 'oidc-client-ts'; + +import THXClient from '../client/Client'; import CacheManager from './CacheManager'; export default class UserManager extends CacheManager { diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000..f1a599a --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,16 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + // match output dir to input dir. e.g. dist/index instead of dist/src/index + "rootDir": "./src", + // "outDir": "./lib", + // output .d.ts declaration files for consumers + "declaration": true, + "declarationMap": true, + "noEmit": false, + "emitDeclarationOnly": true, + "tsBuildInfoFile": "tsconfig.build.tsbuildinfo" + }, + "files": ["src/index.ts"], + "include": [] +} diff --git a/tsconfig.json b/tsconfig.json index 62d347d..299b6c9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */