Code Monkey home page Code Monkey logo

buidler-aragon's Introduction

Aragon Buidler plugin

Buidler plugin for developing Aragon apps with full front end and back end hot reloading.

Required plugins

This plugin currently requires:

Installation

yarn add --dev @aragon/buidler-aragon @nomiclabs/buidler-truffle5 @nomiclabs/buidler-web3 web3

And add the following statement to your buidler.config.js:

usePlugin('@aragon/buidler-aragon')

Tasks

Start task

This plugin provides the "start" task, which allows you to develop an application while visualizing it in the browser.

Task options:

  • openBrowser: Whether or not to automatically open a browser tab with the client when running this task.
  • Please use buidler.config.js for additional options.

Environment extensions

This plugin does not extend the environment.

Usage

To use this plugin, please use create-aragon-app with the buidler boilerplate option. For instructions on how to use this boilerplate, please refer to aragon-buidler-boilerplate.

If you don't want to use a create-aragon-app or a boilerplate, you can follow the structure of the boilerplate linked above. In essence, the regular structure of a Buidler project should do. Please refer to the Buidler docs.

Configuration

This plugin extends BuidlerConfig by adding the following fields:

export interface AragonConfig {
  appServePort?: number
  clientServePort?: number
  appSrcPath?: string
  appBuildOutputPath?: string
  hooks?: AragonConfigHooks
}

Hooks

If you need to perform some tasks before deploying your application's proxy, e.g. deploying a token and passing that token in your proxy's initialize function, you can use the hooks object within the BuidlerConfig object. This object simply contains functions, which, if named correctly, will be called at the appropriate moments in the development pipeline:

export interface AragonConfigHooks {
  preDao?: (bre: BuidlerRuntimeEnvironment) => Promise<void> | void
  postDao?: (
    dao: KernelInstance,
    bre: BuidlerRuntimeEnvironment
  ) => Promise<void> | void
  preInit?: (bre: BuidlerRuntimeEnvironment) => Promise<void> | void
  postInit?: (
    proxy: Truffle.ContractInstance,
    bre: BuidlerRuntimeEnvironment
  ) => Promise<void> | void
  getInitParams?: (bre: BuidlerRuntimeEnvironment) => Promise<any[]> | any[]
  postUpdate?: (
    proxy: Truffle.ContractInstance,
    bre: BuidlerRuntimeEnvironment
  ) => Promise<void> | void
}

For an example on how to use these hooks, please see the token-wrapper tests within the plugin's test projects.

Development

Please refer to the Buidler docs for plugin development.

After cloning this repository, make sure you run npm run dev so that all required contract artifacts are available.

Typescript support

You need to add this to your tsconfig.json's files array: "node_modules/@aragon/buidler-aragon/src/type-extensions.d.ts"

buidler-aragon's People

Contributors

theethernaut avatar 0xgabi avatar dapplion avatar dependabot[bot] avatar cameronfyfe avatar macor161 avatar sohkai avatar xuhcc avatar willjgriff avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.