Skip to content

Commit

Permalink
- update packages
Browse files Browse the repository at this point in the history
- build types
- source maps
  • Loading branch information
chaitanyapotti committed Jul 2, 2020
1 parent e2413ab commit 31e6438
Show file tree
Hide file tree
Showing 34 changed files with 2,817 additions and 1,162 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
examples/
examples/
types/
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@

npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn-error.log*
types/
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This repo allows web applications to directly retrieve keys stored on the Torus
This module is distributed in 3 formats

- `commonjs` build `dist/directWebSdk.cjs.js` in es5 format
- `commonjs` build `dist/directWebSdk-bundled.cjs.js` in es5 format with problematic packages bundled (benfits non-webpack users)
- `umd` build `dist/directWebSdk.umd.min.js` in es5 format without polyfilling corejs minified
- `umd` build `dist/directWebSdk.polyfill.umd.min.js` in es5 format with polyfilling corejs minified

Expand Down Expand Up @@ -59,9 +60,9 @@ To allow your web app to retrieve keys:

2. If you're using `redirectToOpener`, modify the origin of postMessage from `"http://localhost:3000"` to your hosted domain in redirect.html and sw.js

3. Serve [service worker](public/sw.js) from `baseUrl` where baseUrl is the one passed while instantiating `DirectWebSdk` for specific login (example http://localhost:3000/serviceworker/). If you're already using a sw, pls ensure to port over the fetch override from [our service worker](public/sw.js)
3. Serve [service worker](serviceworker/sw.js) from `baseUrl` where baseUrl is the one passed while instantiating `DirectWebSdk` for specific login (example http://localhost:3000/serviceworker/). If you're already using a sw, pls ensure to port over the fetch override from [our service worker](serviceworker/sw.js)

4. For browsers where service workers are not supported or if you wish to not use service workers, create and serve [redirect page](public/redirect.html) from `baseUrl/redirect` where baseUrl is the one passed while instantiating `DirectWebSdk` for specific login ( example http://localhost:3000/serviceworker/)
4. For browsers where service workers are not supported or if you wish to not use service workers, create and serve [redirect page](serviceworker/redirect.html) from `baseUrl/redirect` where baseUrl is the one passed while instantiating `DirectWebSdk` for specific login ( example http://localhost:3000/serviceworker/)

5. At verifier's interface (where you obtain client id), please use `baseUrl/redirect` (eg: http://localhost:3000/serviceworker/redirect) as the redirect_uri where baseUrl is the one passed while instantiating `DirectWebSdk`

Expand Down Expand Up @@ -170,4 +171,4 @@ await axios.post("https://discordapp.com/api/oauth2/token/revoke", formData, {
- Node 10+

### Note
If you are using the redirectToOpener option, you *must* update your redirect.html to [allow whitelisted URIs](https://github.com/torusresearch/serviceworker-server/blob/2d1b5e886a96d544f9fbd04f8a59cdc2d794240e/public/redirect.html#L222)
If you are using the redirectToOpener option, you *must* update your redirect.html to [allow whitelisted URIs](serviceworker/redirect.html#L222)
146 changes: 129 additions & 17 deletions examples/vue-app/package-lock.json

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

3 changes: 2 additions & 1 deletion examples/vue-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@toruslabs/torus-direct-web-sdk": "file:../../toruslabs-torus-direct-web-sdk-3.0.3.tgz",
"@toruslabs/torus-direct-web-sdk": "file:../../toruslabs-torus-direct-web-sdk-3.0.5.tgz",
"core-js": "^3.6.5",
"vue": "^2.6.11"
},
Expand All @@ -19,6 +19,7 @@
"babel-eslint": "^10.1.0",
"eslint": "^7.2.0",
"eslint-plugin-vue": "^6.2.2",
"source-map-loader": "^1.0.1",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
Expand Down
13 changes: 13 additions & 0 deletions examples/vue-app/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,17 @@ module.exports = {
],
},
},
configureWebpack: (config) => {
config.devtool = 'source-map'
},
chainWebpack: config => {

config.module
.rule('sourcemap')
.test(/\.js$/)
.enforce('pre')
.use('source-map-loader')
.loader('source-map-loader')
.end()
}
};
Loading

0 comments on commit 31e6438

Please sign in to comment.