Include workspace deps (demos) from build (#220)

* Include workspace deps (demos) from build

* Fix React demo
This commit is contained in:
Jaco Greeff
2019-10-01 16:02:35 +02:00
committed by GitHub
parent f00ff53fc1
commit a0637fee5b
6 changed files with 22 additions and 17 deletions
+7 -5
View File
@@ -13,14 +13,16 @@
"typescript": "^3.6.3"
},
"scripts": {
"build": "polkadot-dev-build-ts && polkadot-dev-build-docs",
"build": "yarn build:ts && yarn build:docs",
"build:docs": "polkadot-dev-build-docs",
"build:ts": "polkadot-dev-build-ts",
"check": "yarn lint",
"lint": "eslint --ext .js,.jsx,.ts,.tsx . && tsc --noEmit --pretty",
"clean": "polkadot-dev-clean-build",
"demo:identicon:react": "webpack-serve --config packages/react-identicon/webpack.config.js --content packages/react-identicon --port 8080",
"demo:identicon:vue": "webpack-serve --config packages/vue-identicon/webpack.config.js --content packages/vue-identicon --port 8080",
"example:react": "cd packages/example-react && webpack --config webpack.config.js",
"example:vue": "cd packages/example-vue && webpack --config webpack.config.js",
"demo:identicon:react": "yarn build:ts && webpack-serve --config packages/react-identicon/webpack.config.js --content packages/react-identicon --port 8080",
"demo:identicon:vue": "yarn build:ts && webpack-serve --config packages/vue-identicon/webpack.config.js --content packages/vue-identicon --port 8080",
"example:react": "yarn build:ts && cd packages/example-react && webpack --config webpack.config.js",
"example:vue": "yarn build:ts && cd packages/example-vue && webpack --config webpack.config.js",
"postinstall": "polkadot-dev-yarn-only",
"test": "jest --coverage --runInBand",
"test:one": "jest"
+4 -4
View File
@@ -19,10 +19,10 @@ module.exports = {
},
resolve: {
alias: {
'@polkadot/react-identicon': path.resolve(__dirname, '../react-identicon/src'),
'@polkadot/ui-keyring': path.resolve(__dirname, '../ui-keyring/src'),
'@polkadot/ui-settings': path.resolve(__dirname, '../ui-settings/src'),
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/src')
'@polkadot/react-identicon': path.resolve(__dirname, '../react-identicon/build'),
'@polkadot/ui-keyring': path.resolve(__dirname, '../ui-keyring/build'),
'@polkadot/ui-settings': path.resolve(__dirname, '../ui-settings/build'),
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/build')
},
extensions: ['.js', '.ts', '.tsx']
},
+4 -4
View File
@@ -21,10 +21,10 @@ module.exports = {
},
resolve: {
alias: {
'@polkadot/ui-keyring': path.resolve(__dirname, '../ui-keyring/src'),
'@polkadot/ui-settings': path.resolve(__dirname, '../ui-settings/src'),
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/src'),
'@polkadot/vue-identicon': path.resolve(__dirname, '../vue-identicon/src')
'@polkadot/ui-keyring': path.resolve(__dirname, '../ui-keyring/build'),
'@polkadot/ui-settings': path.resolve(__dirname, '../ui-settings/build'),
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/build'),
'@polkadot/vue-identicon': path.resolve(__dirname, '../vue-identicon/build')
},
extensions: ['.js', '.ts', '.tsx']
},
+4 -2
View File
@@ -8,6 +8,8 @@ import { encodeAddress, randomAsU8a } from '@polkadot/util-crypto';
import IdentityIcon from '.';
const THEMES = ['beachball', 'polkadot', 'substrate'];
export default class Demo extends React.PureComponent {
public render (): React.ReactNode {
const identities: string[] = [];
@@ -18,10 +20,10 @@ export default class Demo extends React.PureComponent {
);
}
return identities.map((value): React.ReactNode => (
return identities.map((value, index): React.ReactNode => (
<IdentityIcon
key={value.toString()}
theme='jdenticon'
theme={THEMES[index % THEMES.length] as 'empty'}
value={value}
/>
));
+2 -1
View File
@@ -19,7 +19,8 @@ module.exports = {
},
resolve: {
alias: {
'@polkadot/ui-settings': path.resolve(__dirname, '../ui-settings/src')
'@polkadot/ui-settings': path.resolve(__dirname, '../ui-settings/build'),
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/build')
},
extensions: ['.js', '.jsx', '.ts', '.tsx']
},
+1 -1
View File
@@ -20,7 +20,7 @@ module.exports = {
},
resolve: {
alias: {
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/src')
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/build')
},
extensions: ['.js', '.ts']
},