badboy2174 / bohr-extension-v2

BOHRweb/bohr-extension-v2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BoHr Browser Extension

Building locally

  • Install Node.js version 14
    • If you are using nvm (recommended) running nvm use will automatically choose the right node version for you.
  • Install Yarn
  • Install dependencies: yarn setup (not the usual install command)
  • Copy the .bohr.dist file to .bohr
    • Replace the INFURA_PROJECT_ID value with your own personal Infura Project ID.
    • If debugging MetaMetrics, you'll need to add a value for SEGMENT_WRITE_KEY Segment write key.
  • Build the project to the ./dist/ folder with yarn dist.

Uncompressed builds can be found in /dist, compressed builds can be found in /builds once they're built.

Contributing

Development builds

To start a development build (e.g. with logging and file watching) run yarn start.

To start the React DevTools and Redux DevTools Extension alongside the app, use yarn start:dev.

  • React DevTools will open in a separate window; no browser extension is required
  • Redux DevTools will need to be installed as a browser extension. Open the Redux Remote Devtools to access Redux state logs. This can be done by either right clicking within the web browser to bring up the context menu, expanding the Redux DevTools panel and clicking Open Remote DevTools OR clicking the Redux DevTools extension icon and clicking Open Remote DevTools.
    • You will also need to check the "Use custom (local) server" checkbox in the Remote DevTools Settings, using the default server configuration (host localhost, port 8000, secure connection checkbox unchecked)

Changing dependencies

Whenever you change dependencies (adding, removing, or updating, either in package.json or yarn.lock), there are various files that must be kept up-to-date.

  • yarn.lock:
    • Run yarn setup again after your changes to ensure yarn.lock has been properly updated.
  • The allow-scripts configuration in package.json
    • Run yarn allow-scripts auto to update the allow-scripts configuration automatically. This config determines whether the package's install/postinstall scripts are allowed to run. Review each new package to determine whether the install script needs to run or not, testing if necessary.
    • Unfortunately, yarn allow-scripts auto will behave inconsistently on different platforms. macOS and Windows users may see extraneous changes relating to optional dependencies.
  • The LavaMoat auto-generated policy in lavamoat/node/policy.json
    • Run yarn lavamoat:auto to re-generate this policy file. Review the changes to determine whether the access granted to each package seems appropriate.
    • Unfortunately, yarn lavamoat:auto will behave inconsistently on different platforms. macOS and Windows users may see extraneous changes relating to optional dependencies.

Architecture

[Architecture Diagram][1]

Development

yarn
yarn start

Build for Publishing

yarn dist

About

BOHRweb/bohr-extension-v2

License:Other


Languages

Language:JavaScript 91.4%Language:SCSS 7.9%Language:Shell 0.4%Language:HTML 0.3%Language:Awk 0.0%