import 'package:angular2/src/transform/common/names.dart';
import 'package:build/build.dart';
import 'package:source_gen/source_gen.dart';

import 'template_compiler/generator.dart';
import 'template_compiler/generator_options.dart';

export 'template_compiler/generator_options.dart';

Builder createSourceGenTemplateCompiler(GeneratorOptions options) =>
    new GeneratorBuilder([new TemplateGenerator(options)],
        generatedExtension: TEMPLATE_EXTENSION, isStandalone: true);

import 'package:angular2/src/transform/common/names.dart';
import 'package:build/build.dart';
import 'package:dart_style/dart_style.dart';
import 'package:source_gen/source_gen.dart';

import 'template_compiler/generator.dart';
import 'template_compiler/generator_options.dart';

export 'template_compiler/generator_options.dart';

Builder createSourceGenTemplateCompiler(GeneratorOptions options) =>
    new GeneratorBuilder([new TemplateGenerator(options)],
        formatOutput: (String original) => _formatter.format(original),
        generatedExtension: TEMPLATE_EXTENSION,
        isStandalone: true);

// Note: Use an absurdly long line width in order to speed up the formatter. We
// still get a lot of other formatting, such as forced line breaks (after
// semicolons for instance), spaces in argument lists, etc.
final _formatter = new DartFormatter(pageWidth: 1000000);

Format angular templates with a large line length to speed up the formatter greatly.
Format angular templates with a large line length to speed up the formatter greatly.

Example on large component with this change:
https://paste.googleplex.com/5120874793402368

Example on large component with no formatting:
https://paste.googleplex.com/4604950336241664

Example on large component with default formatting:
https://paste.googleplex.com/5670520280317952

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157787350
