mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-06-24 07:41:03 +00:00
Include workspace deps (demos) from build (#220)
* Include workspace deps (demos) from build * Fix React demo
This commit is contained in:
+7
-5
@@ -13,14 +13,16 @@
|
|||||||
"typescript": "^3.6.3"
|
"typescript": "^3.6.3"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"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",
|
"check": "yarn lint",
|
||||||
"lint": "eslint --ext .js,.jsx,.ts,.tsx . && tsc --noEmit --pretty",
|
"lint": "eslint --ext .js,.jsx,.ts,.tsx . && tsc --noEmit --pretty",
|
||||||
"clean": "polkadot-dev-clean-build",
|
"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:react": "yarn build:ts && 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",
|
"demo:identicon:vue": "yarn build:ts && 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:react": "yarn build:ts && cd packages/example-react && webpack --config webpack.config.js",
|
||||||
"example:vue": "cd packages/example-vue && webpack --config webpack.config.js",
|
"example:vue": "yarn build:ts && cd packages/example-vue && webpack --config webpack.config.js",
|
||||||
"postinstall": "polkadot-dev-yarn-only",
|
"postinstall": "polkadot-dev-yarn-only",
|
||||||
"test": "jest --coverage --runInBand",
|
"test": "jest --coverage --runInBand",
|
||||||
"test:one": "jest"
|
"test:one": "jest"
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@polkadot/react-identicon': path.resolve(__dirname, '../react-identicon/src'),
|
'@polkadot/react-identicon': path.resolve(__dirname, '../react-identicon/build'),
|
||||||
'@polkadot/ui-keyring': path.resolve(__dirname, '../ui-keyring/src'),
|
'@polkadot/ui-keyring': path.resolve(__dirname, '../ui-keyring/build'),
|
||||||
'@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/src')
|
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/build')
|
||||||
},
|
},
|
||||||
extensions: ['.js', '.ts', '.tsx']
|
extensions: ['.js', '.ts', '.tsx']
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@polkadot/ui-keyring': path.resolve(__dirname, '../ui-keyring/src'),
|
'@polkadot/ui-keyring': path.resolve(__dirname, '../ui-keyring/build'),
|
||||||
'@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/src'),
|
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/build'),
|
||||||
'@polkadot/vue-identicon': path.resolve(__dirname, '../vue-identicon/src')
|
'@polkadot/vue-identicon': path.resolve(__dirname, '../vue-identicon/build')
|
||||||
},
|
},
|
||||||
extensions: ['.js', '.ts', '.tsx']
|
extensions: ['.js', '.ts', '.tsx']
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import { encodeAddress, randomAsU8a } from '@polkadot/util-crypto';
|
|||||||
|
|
||||||
import IdentityIcon from '.';
|
import IdentityIcon from '.';
|
||||||
|
|
||||||
|
const THEMES = ['beachball', 'polkadot', 'substrate'];
|
||||||
|
|
||||||
export default class Demo extends React.PureComponent {
|
export default class Demo extends React.PureComponent {
|
||||||
public render (): React.ReactNode {
|
public render (): React.ReactNode {
|
||||||
const identities: string[] = [];
|
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
|
<IdentityIcon
|
||||||
key={value.toString()}
|
key={value.toString()}
|
||||||
theme='jdenticon'
|
theme={THEMES[index % THEMES.length] as 'empty'}
|
||||||
value={value}
|
value={value}
|
||||||
/>
|
/>
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
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']
|
extensions: ['.js', '.jsx', '.ts', '.tsx']
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/src')
|
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/build')
|
||||||
},
|
},
|
||||||
extensions: ['.js', '.ts']
|
extensions: ['.js', '.ts']
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user