Fixes for parity-extension (#6990)

* Fix extension support.

* Fix environment variables on windows.

* Fix package-lock.json

* Fix build issues.
This commit is contained in:
Tomasz Drwięga 2017-11-09 13:20:26 +01:00 committed by Jaco Greeff
parent b3795ac0b5
commit aaeb5d4cd7
4 changed files with 77 additions and 1047 deletions

1092
js/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -21,16 +21,12 @@
"Parity"
],
"scripts": {
"build": "npm run build:lib && npm run build:app",
"build": "npm run build:lib && npm run build:app && npm run build:embed",
"build:app": "webpack --progress --config webpack/app",
"build:lib": "webpack --progress --config webpack/libraries",
"build:embed": "EMBED=1 node webpack/embed",
"build:embed": "cross-env EMBED=1 node webpack/embed",
"build:i18n": "npm run clean && npm run build && babel-node ./scripts/build-i18n.js",
"ci:build": "npm run ci:build:lib && npm run ci:build:app && npm run ci:build:embed",
"ci:build:app": "NODE_ENV=production webpack --progress --config webpack/app",
"ci:build:lib": "NODE_ENV=production webpack --progress --config webpack/libraries",
"ci:build:npm": "NODE_ENV=production webpack --progress --config webpack/npm",
"ci:build:embed": "NODE_ENV=production EMBED=1 node webpack/embed",
"ci:build": "cross-env NODE_ENV=production npm run build",
"clean": "rm -rf ./.build ./.coverage ./.happypack ./build ./node_modules/.cache",
"coveralls": "npm run testCoverage && coveralls < coverage/lcov.info",
"lint": "npm run lint:css && npm run lint:js",
@ -44,9 +40,9 @@
"start": "npm run clean && npm install && npm run build:lib && npm run start:app",
"start:app": "node webpack/dev.server",
"start:electron": "npm run build:app && electron .build/",
"test": "NODE_ENV=test mocha --compilers ejs:ejsify 'src/**/*.spec.js'",
"test:coverage": "NODE_ENV=test istanbul cover _mocha -- --compilers ejs:ejsify 'src/**/*.spec.js'",
"test:e2e": "NODE_ENV=test mocha 'src/**/*.e2e.js'",
"test": "cross-env NODE_ENV=test mocha --compilers ejs:ejsify 'src/**/*.spec.js'",
"test:coverage": "cross-env NODE_ENV=test istanbul cover _mocha -- --compilers ejs:ejsify 'src/**/*.spec.js'",
"test:e2e": "cross-env NODE_ENV=test mocha 'src/**/*.e2e.js'",
"test:npm": "(cd .npmjs && npm i) && node test/npmParity && node test/npmJsonRpc && (rm -rf .npmjs/node_modules)",
"prepush": "npm run lint:cached"
},
@ -75,6 +71,7 @@
"copy-webpack-plugin": "4.0.1",
"core-js": "2.4.1",
"coveralls": "2.11.16",
"cross-env": "5.1.1",
"css-loader": "0.28.4",
"ejs-loader": "0.3.0",
"ejsify": "1.0.0",

View File

@ -31,6 +31,7 @@ import { patchApi } from '@parity/shared/util/tx';
import SecureApi from './secureApi';
import './ShellExtend';
import '@parity/shared/environment';
import '@parity/shared/assets/fonts/Roboto/font.css';
import '@parity/shared/assets/fonts/RobotoMono/font.css';
@ -70,8 +71,6 @@ class FrameSecureApi extends SecureApi {
connect () {
// Do nothing - this API does not need connecting
this.emit('connecting');
// Fetch settings
this._fetchSettings();
// Fire connected event with some delay.
setTimeout(() => {
this.emit('connected');
@ -99,7 +98,7 @@ transport.uiUrl = uiUrl.replace('http://', '').replace('https://', '');
const api = new FrameSecureApi(transport);
patchApi(api);
ContractInstances.create(api);
ContractInstances.get(api);
const store = initStore(api, null, true);
@ -125,3 +124,9 @@ ReactDOM.render(
</AppContainer>,
container
);
// testing, signer plugins
import '@parity/plugin-signer-account';
import '@parity/plugin-signer-default';
import '@parity/plugin-signer-hardware';
import '@parity/plugin-signer-qr';

View File

@ -46,7 +46,7 @@ const isProd = ENV === 'production';
const isEmbed = EMBED === '1' || EMBED === 'true';
const entry = isEmbed
? { embed: './embed.js' }
? { embed: ['babel-polyfill', './embed.js'] }
: { bundle: ['babel-polyfill', './index.parity.js'] };
module.exports = {
@ -238,7 +238,7 @@ module.exports = {
new HtmlWebpackPlugin({
title: 'Parity Bar',
filename: 'embed.html',
template: './index.ejs',
template: './index.parity.ejs',
favicon: FAVICON,
chunks: ['embed']
})