# Generator

Generator options modify the behaviour of the code generator.

// gemforge.config.cjs
module.exports = {
  ...
  generator: {
    // OPTIONAL - proxy contract (DiamondProxy.sol) options
    proxy: {
      // custom template to use instead of the Gemforge default one
      template: '/path/to/custom-DiamondProxy-template.sol'
    },
    // proxy interface options
    proxyInterface: {
      // imports to include in the generated IDiamondProxy interface
      imports: [],
    },
  },
  ...
}

# Proxy template

By default Gemforge uses its own DiamondProxy.sol template to generate the final proxy contract code.

However, advanced users may wish to have more control, including using custom upgrade facets. In these cases, set the generator.proxy.template key to point to a custom template file to use instead of the default.

We recommend basing custom proxy templates on the Gemforge default one and making only the necessary modifications. Examples can be found in the Gemforge test codebase.

# Proxy interface imports

The generator.proxyInterface.imports array lists files which should be imported within the generated diamond proxy interface code.

For example, you need to use this when dealing with custom structs.