DevCommand constructor

DevCommand({
  1. required ConstructEntrypointHandler generator,
  2. required Logger logger,
  3. required FileSystem fs,
})

Implementation

DevCommand({
  required ConstructEntrypointHandler generator,
  required this.logger,
  required this.fs,
}) : _generator = generator {
  argParser
    ..addFlag(
      'recompile',
      help:
          'Re-compiles the construct kernel. '
          'Needed to sync changes for a local construct.',
      negatable: false,
    )
    ..addOption(
      'flavor',
      abbr: 'f',
      help: 'The flavor to use for the app (case-sensitive)',
    )
    ..addFlag(
      'release',
      help:
          'Whether to run in release mode. Disables hot reload and debugger',
      negatable: false,
    )
    ..addFlag(
      'profile',
      help:
          'Whether to run in profile mode. Enables logger, '
          'but disables hot reload and debugger',
      negatable: false,
    )
    ..addFlag(
      'debug',
      help:
          '(Default) Whether to run in debug mode. '
          'Enables hot reload and debugger',
      negatable: false,
    )
    ..addFlag(
      'generate-only',
      help: 'Only generate the constructs, does not run the server',
      negatable: false,
      hide: true,
    )
    ..addOption(
      'dart-vm-service-port',
      help:
          'The port to use for the Dart VM service. '
          'Use 0 to automatically assign a port.',
      defaultsTo: '0',
    )
    ..addMultiOption(
      'dart-define',
      abbr: 'D',
      help: 'Additional key-value pairs that will be available as constants.',
      valueHelp: 'BASE_URL=https://api.example.com',
    )
    ..addMultiOption(
      'dart-define-from-file',
      help:
          'A file containing additional key-value '
          'pairs that will be available as constants.',
      valueHelp: '.env',
    );
}