Skip to content

Config file improvements #166

Description

@sz-piotr

The config used currently by waffle is a result of incrementally adding new options without regard for existing ones. The proposed config unifies the options and allows for better user experience.

The values will be checked in runtime for correctness. Changing the config will also open a path for usability improvements for specifying compiler versions. The resulting code will be fully backwards compatible and will issue proper deprecation warnings to smoothen the transition.

The new code will also lay a foundation for future config extensions in a more organised manner.

export interface Config {
  /** Location of the project sources e.g. ./contracts */
  sourceDirectory: string;
  /** Location of the compilation artifacts e.g. ./dist */
  outputDirectory: string;
  /** Location of the dependencies e.g. ./node_modules */
  nodeModulesDirectory: string;

  /**
   * Compiler type:
   * - native - uses local installation of solc
   * - dockerized-solc - uses solc from a docker image
   * - solcjs - uses solc from the solcjs npm package
   */
  compilerType: 'native' | 'dockerized-solc' | 'solcjs';
  /** Version of the solidity compiler e.g. "0.5.1" or "default" */
  compilerVersion: string;
  /**
   * Additional allowed paths for the compiler.
   * Only used for native compiler type.
   */
  compilerAllowedPaths: string[];
  /** Options passed to the compiler */
  compilerOptions: object;

  /** Include the humanReadableAbi format */
  outputHumanReadableAbi: boolean;
  /**
   * What files should be outputted
   * - multiple - single file for each contract
   * - combined - single file for all contracts
   * - all - both of the above
   */
  outputType: 'multiple' | 'combined' | 'all';
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    waffle-3.0.0Part of the improvements for Waffle 3

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions