diff --git a/.env.demo.example b/.env.demo.example index 5c2501b..f05bf2a 100644 --- a/.env.demo.example +++ b/.env.demo.example @@ -1,2 +1 @@ -IDP_SELECT_URI=http://localhost:8081/popup.html -CALLBACK_URI=http://localhost:8081/popup.html +POPUP_URI=http://localhost:8081/popup.html diff --git a/package.json b/package.json index c240726..35fdb07 100644 --- a/package.json +++ b/package.json @@ -3,18 +3,18 @@ "version": "0.4.0", "description": "Opaquely authenticates solid clients", "main": "lib/index.js", - "files": [ - "lib", - "dist-lib" - ], + "files": ["lib", "dist-lib"], "repository": "git@github.com:solid/solid-auth-client.git", "author": "Daniel Friedman ", "license": "MIT", "scripts": { - "start:demo": "webpack-dev-server --env development --config=./webpack/webpack.demo.config.js", - "start:popup": "webpack-dev-server --env development --config=./webpack/webpack.popup.config.js", + "start:demo": + "webpack-dev-server --env development --config=./webpack/webpack.demo.config.js", + "start:popup": + "webpack-dev-server --env development --config=./webpack/webpack.popup.config.js", "jest": "jest src --coverage", - "format": "prettier --parser flow --no-semi --single-quote --write '{src,demo,popup-app}/**/*.js'", + "format": + "prettier --parser flow --no-semi --single-quote --write '{src,demo,popup-app}/**/*.js'", "prelint": "yarn format", "lint": "eslint '{src,demo,popup-app}/**/*.js'", "pretest": "flow && yarn lint", @@ -26,7 +26,8 @@ "build:lib": "rm -rf lib && babel --ignore '**.spec.js' src -d lib", "build:lib:umd": "webpack --config=./webpack/webpack.lib.config.js -p", "build:demo": "webpack --config=./webpack/webpack.demo.config.js -p", - "build:popup": "webpack --config=./webpack/webpack.popup.config.js -p", + "build:popup": + "webpack --config=./webpack/webpack.popup.config.js -p && rm ./dist-popup/popup.bundle.js", "preversion": "yarn test", "postversion": "git push --follow-tags", "prepublishOnly": "yarn build" @@ -84,7 +85,5 @@ "jest": { "testURL": "https://app.biz/page?foo=bar#more-params" }, - "pre-commit": [ - "test" - ] + "pre-commit": ["test"] } diff --git a/webpack.config.demo.js b/webpack.config.demo.js deleted file mode 100644 index bff6ceb..0000000 --- a/webpack.config.demo.js +++ /dev/null @@ -1,45 +0,0 @@ -const path = require('path') -const webpack = require('webpack') -const HtmlWebpackPlugin = require('html-webpack-plugin') - -module.exports = { - entry: './demo/index.js', - output: { - filename: 'app.js', - path: path.resolve(__dirname, 'docs') - }, - module: { - rules: [ - { - test: /\.js$/, - loader: 'babel-loader', - exclude: /node_modules/ - }, - { - test: /^.*\/oidc-rp\/.*\.js$/, - loader: 'babel-loader' - }, - { - test: /\.css$/, - use: [ 'style-loader', 'css-loader' ] - } - ] - }, - externals: { - 'node-fetch': 'fetch', - 'text-encoding': 'TextEncoder', - 'whatwg-url': 'window', - '@trust/webcrypto': 'crypto' - }, - plugins: [ - new HtmlWebpackPlugin({ - title: 'Solid Auth Client', - hash: true - }) - ], - devtool: 'source-map', - devServer: { - contentBase: path.join(__dirname, 'docs'), - historyApiFallback: true - } -} diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index 95c62f8..0000000 --- a/webpack.config.js +++ /dev/null @@ -1,35 +0,0 @@ -const path = require('path') -const webpack = require('webpack') - -module.exports = { - entry: './src/index.js', - output: { - filename: 'solid-auth-client.min.js', - path: path.resolve(__dirname, 'dist'), - library: 'SolidAuthClient', - libraryTarget: 'umd' - }, - module: { - rules: [ - { - test: /\.js$/, - loader: 'babel-loader', - exclude: /node_modules/ - }, - { - test: /^.*\/oidc-rp\/.*\.js$/, - loader: 'babel-loader' - } - ] - }, - externals: { - 'node-fetch': 'fetch', - 'text-encoding': 'TextEncoder', - 'whatwg-url': 'window', - '@trust/webcrypto': 'crypto' - }, - devtool: 'source-map', - plugins: [ - new webpack.optimize.UglifyJsPlugin({ sourceMap: true }) - ] -} diff --git a/webpack/webpack.popup.config.js b/webpack/webpack.popup.config.js index da0b3ef..90341b3 100644 --- a/webpack/webpack.popup.config.js +++ b/webpack/webpack.popup.config.js @@ -3,13 +3,8 @@ const DotenvPlugin = require('dotenv-webpack') const HtmlWebpackPlugin = require('html-webpack-plugin') const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin') const path = require('path') -const webpack = require('webpack') -const { - module: _module, - externals, - devtool -} = require('./webpack.common.config') +const { module: _module, externals } = require('./webpack.common.config') const outputDir = './dist-popup' @@ -42,10 +37,8 @@ module.exports = { filename: 'popup.html', inlineSource: '.(js|css)$' }), - new HtmlWebpackInlineSourcePlugin(), - new webpack.HotModuleReplacementPlugin(outputDir) + new HtmlWebpackInlineSourcePlugin() ], - devtool, devServer: { contentBase: path.join(__dirname, 'dist') }