Skip to content

Commit

Permalink
Add wrapper package
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitanyapotti committed Apr 5, 2021
1 parent 132ca4a commit 3141478
Show file tree
Hide file tree
Showing 9 changed files with 454 additions and 313 deletions.
13 changes: 13 additions & 0 deletions packages/wrapper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# `openlogin`

> TODO: description


## Usage

```
const openlogin = require('openlogin');
// TODO: DEMONSTRATE API
```
4 changes: 4 additions & 0 deletions packages/wrapper/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from "@toruslabs/openlogin";
export { default } from "@toruslabs/openlogin";
export * as jrpc from "@toruslabs/openlogin-jrpc";
export * as utils from "@toruslabs/openlogin-utils";
53 changes: 53 additions & 0 deletions packages/wrapper/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "openlogin",
"version": "0.3.8",
"homepage": "https://github.com/torusresearch/OpenLoginSdk#readme",
"license": "ISC",
"main": "dist/openlogin.cjs.js",
"unpkg": "dist/openlogin.umd.min.js",
"jsdelivr": "dist/openlogin.umd.min.js",
"types": "types/index.d.ts",
"author": "Torus Labs",
"scripts": {
"test": "cross-env MOCKED=true mocha --config ../../.mocharc.json ",
"test-development": "cross-env MOCKED=false METADATA=http://localhost:5051 mocha --config ../../.mocharc.json ",
"test-production": "cross-env MOCKED=false METADATA=https://metadata.tor.us mocha --config ../../.mocharc.json ",
"test-debugger": "mocha --config ../../.mocharc.json --inspect-brk",
"dev": "rimraf dist/ && cross-env NODE_ENV=development parallel-webpack --no-stats",
"build": "rimraf dist/ && cross-env NODE_ENV=production parallel-webpack --no-stats",
"build:types": "rimraf types/ && tsc --project tsconfig.types.json",
"lint": "eslint --fix 'src/**/*.ts' 'index.ts'",
"prepack": "yarn run build && yarn run build:types",
"pre-commit": "lint-staged"
},
"dependencies": {
"@toruslabs/openlogin": "^0.3.8",
"@toruslabs/openlogin-jrpc": "^0.3.8",
"@toruslabs/openlogin-utils": "^0.3.8",
"bn.js": "^5.2.0"
},
"peerDependencies": {
"@babel/runtime": "7.x"
},
"files": [
"dist",
"types"
],
"lint-staged": {
"!(*d).ts": [
"yarn run lint --",
"prettier --write 'src/**/*.ts' 'index.ts'"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/torusresearch/OpenLoginSdk.git"
},
"bugs": {
"url": "https://github.com/torusresearch/OpenLoginSdk/issues"
},
"keywords": [],
"publishConfig": {
"access": "public"
}
}
3 changes: 3 additions & 0 deletions packages/wrapper/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../tsconfig.json",
}
8 changes: 8 additions & 0 deletions packages/wrapper/tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"emitDeclarationOnly": true,
"declarationDir": "types",
"paths": {}
}
}
4 changes: 4 additions & 0 deletions packages/wrapper/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from "@toruslabs/openlogin";
export { default } from "@toruslabs/openlogin";
export * as jrpc from "@toruslabs/openlogin-jrpc";
export * as utils from "@toruslabs/openlogin-utils";
13 changes: 13 additions & 0 deletions packages/wrapper/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require("path");
const generateWebpackConfig = require("../../webpack.config");

const pkg = require("./package.json");

const pkgName = pkg.name.split("/")[1] || pkg.name.split("/")[0];

const currentPath = path.resolve(".");

const config = generateWebpackConfig({ currentPath, pkg, pkgName });

module.exports = config;
8 changes: 8 additions & 0 deletions packages/wrapper/yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


bn.js@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002"
integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==
Loading

0 comments on commit 3141478

Please sign in to comment.