Skip to content

Commit

Permalink
Add craco and browserify packages (#542)
Browse files Browse the repository at this point in the history
* Add craco and browserify

Signed-off-by: Manank Patni <[email protected]>

* Remove react-app-rewired

Signed-off-by: Manank Patni <[email protected]>

* Change admin to deployer account in case of testnet

Signed-off-by: Manank Patni <[email protected]>

---------

Signed-off-by: Manank Patni <[email protected]>
  • Loading branch information
Man-Jain authored Apr 20, 2023
1 parent dcfaccf commit 68a1b1e
Show file tree
Hide file tree
Showing 7 changed files with 3,234 additions and 4,877 deletions.
27 changes: 27 additions & 0 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { ProvidePlugin } = require("webpack")

module.exports = {
webpack: {
configure: {
ignoreWarnings: [/Failed to parse source map/],
resolve: {
fallback: {
assert: require.resolve("assert/"),
crypto: require.resolve("crypto-browserify/"),
http: require.resolve("stream-http/"),
https: require.resolve("https-browserify/"),
os: require.resolve("os-browserify/browser"),
stream: require.resolve("stream-browserify/"),
url: require.resolve("url/"),
util: require.resolve("util/"),
fs: false
}
}
},
plugins: [
new ProvidePlugin({
Buffer: ["buffer", "Buffer"]
})
]
}
}
37 changes: 23 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,64 +4,73 @@
"license": "MIT",
"scripts": {
"start": "serve -s build",
"dev": "react-scripts start",
"build": "react-scripts build && echo '/* /index.html 200' | cat >build/_redirects ",
"dev": "craco start",
"build": "craco build && echo '/* /index.html 200' | cat >build/_redirects ",
"analyze": "source-map-explorer 'build/static/js/*.js'",
"test": "react-scripts test",
"eject": "react-scripts eject",
"test": "craco test",
"eject": "craco eject",
"lint:ci": "eslint --color 'src/**/*.{js,jsx,ts,tsx}'",
"lint:check": "eslint --quiet 'src/**/*.{js,jsx,ts,tsx}'",
"lint:fix": "eslint --fix 'src/**/*.{js,jsx,ts,tsx}'",
"prepare": "husky install"
},
"dependencies": {
"@craco/craco": "^7.1.0",
"@hookform/resolvers": "^2.8.1",
"@material-ui/core": "^4.11.3",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.57",
"@microsoft/signalr": "^5.0.9",
"@taquito/beacon-wallet": "^16.0.1",
"@taquito/signer": "^16.0.1",
"@taquito/taquito": "^16.0.1",
"@taquito/beacon-wallet": "^16.1.2",
"@taquito/signer": "^16.1.2",
"@taquito/taquito": "^16.1.2",
"@taquito/tezbridge-signer": "^14.2.0",
"@taquito/tezbridge-wallet": "^14.2.0",
"@taquito/tzip12": "^16.0.1",
"@taquito/tzip16": "^16.0.1",
"@taquito/tzip12": "^16.1.2",
"@taquito/tzip16": "^16.1.2",
"@types/mixpanel-browser": "^2.35.7",
"@types/prismjs": "^1.26.0",
"@types/react-router-hash-link": "^2.4.5",
"assert": "^2.0.0",
"bignumber.js": "^9.0.1",
"blockies-ts": "^1.0.0",
"crypto-browserify": "^3.12.0",
"dayjs": "^1.10.4",
"formik": "^2.2.6",
"formik-material-ui": "^3.0.1",
"formik-material-ui-lab": "^0.0.8",
"graphql": "^15.5.1",
"graphql-request": "^3.4.0",
"hex-to-rgba": "^2.0.1",
"https-browserify": "^1.0.0",
"jsonschema": "^1.4.0",
"launchdarkly-react-client-sdk": "2.27.0",
"mixpanel-browser": "^2.42.0",
"notistack": "^1.0.3",
"os-browserify": "^0.3.0",
"prism-themes": "^1.9.0",
"prismjs": "^1.28.0",
"react": "^17.0.1",
"react": "^18.2.0",
"react-customizable-progressbar": "^1.0.2",
"react-dom": "^17.0.2",
"react-dom": "^18.2.0",
"react-fitty": "^1.0.1",
"react-hook-form": "^7.15.4",
"react-html-parser": "^2.0.2",
"react-markdown": "^8.0.0",
"react-query": "^3.13.0",
"react-router-dom": "^5.2.0",
"react-router-hash-link": "^2.4.3",
"react-scripts": "4.0.3",
"react-scripts": "^5.0.1",
"react-simple-code-editor": "^0.11.2",
"react-spring-bottom-sheet": "^3.4.0",
"rehype-raw": "^6.1.1",
"remark-breaks": "^3.0.2",
"remark-gfm": "^3.0.1",
"serve": "^11.3.2",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"url": "^0.11.0",
"util": "^0.12.5",
"yup": "^0.32.9"
},
"devDependencies": {
Expand All @@ -83,7 +92,7 @@
"lint-staged": "^13.0.3",
"prettier": "^2.2.0",
"source-map-explorer": "2.5.2",
"typescript": "^4.2.3"
"typescript": "^5.0.4"
},
"resolutions": {
"@types/react": "~17.0.3"
Expand Down Expand Up @@ -115,4 +124,4 @@
"yarn lint:check"
]
}
}
}
158 changes: 82 additions & 76 deletions src/assets/logos/homebase_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/modules/explorer/pages/ProposalDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const InfoCopyIcon = styled(CopyButton)({
}
})

const getReadableConfig = (configKey: keyof Proposal["metadata"]["config"]) => {
const getReadableConfig = (configKey: any) => {
switch (configKey) {
case "frozen_extra_value":
return "Proposal fee"
Expand Down Expand Up @@ -200,7 +200,7 @@ export const ProposalDetails: React.FC = () => {
// proposal.getStatus(cycleInfo.currentLevel).status === ProposalStatus.EXECUTED) &&
// !dao?.data.ledger.find(l => l.holder.address.toLowerCase() === account.toLowerCase())?.staked.isZero()

const parseReadableConfigValue = (configKey: keyof Proposal["metadata"]["config"], value: BigNumber) => {
const parseReadableConfigValue = (configKey: any, value: BigNumber) => {
if (dao) {
switch (configKey) {
case "frozen_extra_value":
Expand Down
5 changes: 2 additions & 3 deletions src/services/beacon/hooks/useTezos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ export const useTezos = (): WalletConnectReturn => {
const { wallet } = await connectWithBeacon(network)

const newTezos: TezosToolkit = initTezosInstance(network || newNetwork)
const account = await newTezos.wallet.pkh()

newTezos.setProvider({ wallet })

const account = await newTezos.wallet.pkh()

dispatch({
type: TezosActionType.UPDATE_TEZOS,
payload: {
Expand All @@ -49,7 +49,6 @@ export const useTezos = (): WalletConnectReturn => {
wallet
}
})

mixpanel.identify(account)

return newTezos
Expand Down
2 changes: 2 additions & 0 deletions src/services/contracts/baseDAO/hooks/useOriginate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export const useOriginate = (template: DAOTemplate) => {
newTezos = initTezosInstance(network)
const signer = await InMemorySigner.fromSecretKey(ALICE_PRIV_KEY)
newTezos.setProvider({ signer })

params.orgSettings.administrator = await newTezos.wallet.pkh()
}

mixpanel.track("Started DAO origination", {
Expand Down
Loading

0 comments on commit 68a1b1e

Please sign in to comment.