Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Build embedded Parity JS properly and separatly #4426

Merged
merged 12 commits into from
Feb 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions js/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"stage-0", "react"
],
"plugins": [
"transform-runtime",
"transform-decorators-legacy",
"transform-class-properties",
"transform-object-rest-spread",
"lodash"
"lodash",
"recharts"
],
"retainLines": true,
"env": {
Expand All @@ -25,7 +25,8 @@
},
"test": {
"plugins": [
["babel-plugin-webpack-alias", { "config": "webpack/test.js" }]
"transform-runtime",
[ "babel-plugin-webpack-alias", { "config": "webpack/test.js" } ]
]
}
}
Expand Down
41 changes: 22 additions & 19 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,20 @@
"Promise"
],
"scripts": {
"build": "npm run build:lib && npm run build:dll && npm run build:app",
"build": "npm run build:lib && npm run build:dll && npm run build:app && npm run build:embed",
"build:app": "webpack --config webpack/app",
"build:lib": "webpack --config webpack/libraries",
"build:dll": "webpack --config webpack/vendor",
"build:markdown": "babel-node ./scripts/build-rpc-markdown.js",
"build:json": "babel-node ./scripts/build-rpc-json.js",
"ci:build": "npm run ci:build:lib && npm run ci:build:dll && npm run ci:build:app",
"build:embed": "EMBED=1 node webpack/embed",
"ci:build": "npm run ci:build:lib && npm run ci:build:dll && npm run ci:build:app && npm run ci:build:embed",
"ci:build:app": "NODE_ENV=production webpack --config webpack/app",
"ci:build:lib": "NODE_ENV=production webpack --config webpack/libraries",
"ci:build:dll": "NODE_ENV=production webpack --config webpack/vendor",
"ci:build:npm": "NODE_ENV=production webpack --config webpack/npm",
"ci:build:jsonrpc": "babel-node ./scripts/build-rpc-json.js --output .npmjs/jsonrpc",
"ci:build:embed": "NODE_ENV=production EMBED=1 node webpack/embed",
"start": "npm install && npm run build:lib && npm run build:dll && npm run start:app",
"start:app": "node webpack/dev.server",
"clean": "rm -rf ./.build ./.coverage ./.happypack ./.npmjs ./build",
Expand All @@ -53,27 +55,28 @@
"prepush": "npm run lint:cached"
},
"devDependencies": {
"babel-cli": "6.18.0",
"babel-core": "6.21.0",
"babel-cli": "6.22.2",
"babel-core": "6.22.1",
"babel-eslint": "7.1.1",
"babel-loader": "6.2.10",
"babel-plugin-lodash": "3.2.11",
"babel-plugin-react-intl": "2.2.0",
"babel-plugin-transform-class-properties": "6.19.0",
"babel-plugin-react-intl": "2.3.1",
"babel-plugin-recharts": "1.1.0",
"babel-plugin-transform-class-properties": "6.22.0",
"babel-plugin-transform-decorators-legacy": "1.3.4",
"babel-plugin-transform-object-rest-spread": "6.20.2",
"babel-plugin-transform-react-remove-prop-types": "0.2.11",
"babel-plugin-transform-runtime": "6.15.0",
"babel-plugin-transform-object-rest-spread": "6.22.0",
"babel-plugin-transform-react-remove-prop-types": "0.3.0",
"babel-plugin-transform-runtime": "6.22.0",
"babel-plugin-webpack-alias": "2.1.2",
"babel-polyfill": "6.20.0",
"babel-preset-env": "1.1.4",
"babel-preset-es2015": "6.18.0",
"babel-preset-es2016": "6.16.0",
"babel-preset-es2017": "6.16.0",
"babel-preset-react": "6.16.0",
"babel-preset-stage-0": "6.16.0",
"babel-register": "6.18.0",
"babel-runtime": "6.20.0",
"babel-polyfill": "6.22.0",
"babel-preset-env": "1.1.8",
"babel-preset-es2015": "6.22.0",
"babel-preset-es2016": "6.22.0",
"babel-preset-es2017": "6.22.0",
"babel-preset-react": "6.22.0",
"babel-preset-stage-0": "6.22.0",
"babel-register": "6.22.0",
"babel-runtime": "6.22.0",
"chai": "3.5.0",
"chai-as-promised": "6.0.0",
"chai-enzyme": "0.6.1",
Expand Down Expand Up @@ -132,7 +135,7 @@
"stylelint": "7.7.0",
"stylelint-config-standard": "15.0.1",
"url-loader": "0.5.7",
"webpack": "2.2.0-rc.2",
"webpack": "2.2.1",
"webpack-dev-middleware": "1.9.0",
"webpack-error-notification": "0.1.6",
"webpack-hot-middleware": "2.14.0",
Expand Down
2 changes: 1 addition & 1 deletion js/src/library.etherscan.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ if (isNode) {

import Etherscan from './3rdparty/etherscan';

module.exports = Etherscan;
export default Etherscan;
2 changes: 1 addition & 1 deletion js/src/library.jsonrpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

import JsonRpc from './jsonrpc';

module.exports = JsonRpc;
export default JsonRpc;
2 changes: 1 addition & 1 deletion js/src/library.parity.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ if (isNode) {
import Abi from './abi';
import Api from './api';

module.exports = { Api, Abi };
export { Api, Abi };
2 changes: 1 addition & 1 deletion js/src/library.shapeshift.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ if (isNode) {

import ShapeShift from './3rdparty/shapeshift';

module.exports = ShapeShift;
export default ShapeShift;
3 changes: 2 additions & 1 deletion js/src/modals/CreateAccount/NewAccount/newAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import { FormattedMessage } from 'react-intl';
import { IconButton } from 'material-ui';
import { RadioButton, RadioButtonGroup } from 'material-ui/RadioButton';

import { Form, Input, IdentityIcon, PasswordStrength } from '~/ui';
import { Form, Input, IdentityIcon } from '~/ui';
import PasswordStrength from '~/ui/Form/PasswordStrength';
import { RefreshIcon } from '~/ui/Icons';

import styles from '../createAccount.css';
Expand Down
3 changes: 2 additions & 1 deletion js/src/modals/CreateAccount/RawKey/rawKey.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import { observer } from 'mobx-react';
import React, { Component, PropTypes } from 'react';
import { FormattedMessage } from 'react-intl';

import { Form, Input, PasswordStrength } from '~/ui';
import { Form, Input } from '~/ui';
import PasswordStrength from '~/ui/Form/PasswordStrength';

import styles from '../createAccount.css';

Expand Down
3 changes: 2 additions & 1 deletion js/src/modals/CreateAccount/RecoveryPhrase/recoveryPhrase.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import React, { Component, PropTypes } from 'react';
import { FormattedMessage } from 'react-intl';
import { Checkbox } from 'material-ui';

import { Form, Input, PasswordStrength } from '~/ui';
import { Form, Input } from '~/ui';
import PasswordStrength from '~/ui/Form/PasswordStrength';

import styles from '../createAccount.css';

Expand Down
3 changes: 2 additions & 1 deletion js/src/modals/LoadContract/loadContract.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import moment from 'moment';
import React, { Component, PropTypes } from 'react';
import { FormattedMessage } from 'react-intl';

import { Button, Modal, Editor } from '~/ui';
import { Button, Modal } from '~/ui';
import Editor from '~/ui/Editor';
import { CancelIcon, CheckIcon, DeleteIcon } from '~/ui/Icons';

import styles from './loadContract.css';
Expand Down
3 changes: 2 additions & 1 deletion js/src/modals/PasswordManager/passwordManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';

import { newError, openSnackbar } from '~/redux/actions';
import { Button, Modal, IdentityName, IdentityIcon, PasswordStrength } from '~/ui';
import { Button, Modal, IdentityName, IdentityIcon } from '~/ui';
import PasswordStrength from '~/ui/Form/PasswordStrength';
import Form, { Input } from '~/ui/Form';
import { CancelIcon, CheckIcon, SendIcon } from '~/ui/Icons';

Expand Down
3 changes: 2 additions & 1 deletion js/src/modals/SaveContract/saveContract.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import React, { Component, PropTypes } from 'react';
import SaveIcon from 'material-ui/svg-icons/content/save';
import ContentClear from 'material-ui/svg-icons/content/clear';

import { Button, Modal, Editor, Form, Input } from '~/ui';
import { Button, Modal, Form, Input } from '~/ui';
import Editor from '~/ui/Editor';
import { ERRORS, validateName } from '~/util/validation';

import styles from './saveContract.css';
Expand Down
23 changes: 23 additions & 0 deletions js/src/redux/providers/workerWrapper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.

// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

if (!process.env.EMBED) {
const setupWorker = require('./worker').setupWorker;

module.exports = { setupWorker };
} else {
module.exports = { setupWorker: () => {} };
}
2 changes: 1 addition & 1 deletion js/src/redux/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import initMiddleware from './middleware';
import initReducers from './reducers';

import { load as loadWallet } from './providers/walletActions';
import { setupWorker } from './providers/worker';
import { setupWorker } from './providers/workerWrapper';

import {
Balances as BalancesProvider,
Expand Down
5 changes: 5 additions & 0 deletions js/src/ui/Actionbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

export Export from './Export';
export Import from './Import';
export Search from './Search';
export Sort from './Sort';

export default from './actionbar';
44 changes: 14 additions & 30 deletions js/src/ui/Form/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,19 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

import AddressSelect from './AddressSelect';
import DappUrlInput from './DappUrlInput';
import FormWrap from './FormWrap';
import Input from './Input';
import InputAddress from './InputAddress';
import InputAddressSelect from './InputAddressSelect';
import InputChip from './InputChip';
import InputDate from './InputDate';
import InputInline from './InputInline';
import InputTime from './InputTime';
import Label from './Label';
import RadioButtons from './RadioButtons';
import Select from './Select';
import TypedInput from './TypedInput';
export AddressSelect from './AddressSelect';
export DappUrlInput from './DappUrlInput';
export FormWrap from './FormWrap';
export Input from './Input';
export InputAddress from './InputAddress';
export InputAddressSelect from './InputAddressSelect';
export InputChip from './InputChip';
export InputDate from './InputDate';
export InputInline from './InputInline';
export InputTime from './InputTime';
export Label from './Label';
export RadioButtons from './RadioButtons';
export Select from './Select';
export TypedInput from './TypedInput';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1


export default from './form';
export {
AddressSelect,
DappUrlInput,
FormWrap,
Input,
InputAddress,
InputAddressSelect,
InputChip,
InputDate,
InputInline,
InputTime,
Label,
RadioButtons,
Select,
TypedInput
};
Loading